MCPcopy Create free account
hub / github.com/Effect-TS/effect / fromChunkPubSub

Function fromChunkPubSub

packages/effect/src/internal/stream.ts:3066–3073  ·  view source on GitHub ↗
(pubsub, options)

Source from the content-addressed store, hash-verified

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 */
3076export const fromChunkQueue = <A>(queue: Queue.Dequeue<Chunk.Chunk<A>>, options?: {

Callers

nothing calls this directly

Calls 4

scopedFunction · 0.70
mapMethod · 0.65
subscribeMethod · 0.65
shutdownMethod · 0.45

Tested by

no test coverage detected