| 3026 | readonly shutdown?: boolean | undefined |
| 3027 | }): Stream.Stream<A> |
| 3028 | } = (pubsub, options): any => { |
| 3029 | if (options?.scoped) { |
| 3030 | const effect = Effect.map(PubSub.subscribe(pubsub), fromChunkQueue) |
| 3031 | return options.shutdown ? Effect.map(effect, ensuring(PubSub.shutdown(pubsub))) : effect |
| 3032 | } |
| 3033 | const stream = flatMap(scoped(PubSub.subscribe(pubsub)), fromChunkQueue) |
| 3034 | return options?.shutdown ? ensuring(stream, PubSub.shutdown(pubsub)) : stream |
| 3035 | } |
| 3036 | |
| 3037 | /** @internal */ |
| 3038 | export const fromChunkQueue = <A>(queue: Queue.Dequeue<Chunk.Chunk<A>>, options?: { |