| 3064 | readonly shutdown?: boolean | undefined |
| 3065 | }): Stream.Stream<A> |
| 3066 | } = (pubsub, options): any => { |
| 3067 | if (options?.scoped) { |
| 3068 | const effect = Effect.map(PubSub.subscribe(pubsub), fromChunkQueue) |
| 3069 | return options.shutdown ? Effect.map(effect, ensuring(PubSub.shutdown(pubsub))) : effect |
| 3070 | } |
| 3071 | const stream = flatMap(scoped(PubSub.subscribe(pubsub)), fromChunkQueue) |
| 3072 | return options?.shutdown ? ensuring(stream, PubSub.shutdown(pubsub)) : stream |
| 3073 | } |
| 3074 | |
| 3075 | /** @internal */ |
| 3076 | export const fromChunkQueue = <A>(queue: Queue.Dequeue<Chunk.Chunk<A>>, options?: { |