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

Function fromChunkQueue

packages/effect/src/internal/stream.ts:3076–3093  ·  view source on GitHub ↗
(queue: Queue.Dequeue<Chunk.Chunk<A>>, options?: {
  readonly shutdown?: boolean | undefined
})

Source from the content-addressed store, hash-verified

3074
3075/** @internal */
3076export const fromChunkQueue = <A>(queue: Queue.Dequeue<Chunk.Chunk<A>>, options?: {
3077 readonly shutdown?: boolean | undefined
3078}): Stream.Stream<A> =>
3079 pipe(
3080 Queue.take(queue),
3081 Effect.catchAllCause((cause) =>
3082 pipe(
3083 Queue.isShutdown(queue),
3084 Effect.flatMap((isShutdown) =>
3085 isShutdown && Cause.isInterrupted(cause) ?
3086 pull.end() :
3087 pull.failCause(cause)
3088 )
3089 )
3090 ),
3091 repeatEffectChunkOption,
3092 options?.shutdown ? ensuring(Queue.shutdown(queue)) : identity
3093 )
3094
3095/** @internal */
3096export const fromChunks = <A>(

Callers

nothing calls this directly

Calls 7

isInterruptedMethod · 0.80
failCauseMethod · 0.80
pipeFunction · 0.70
takeMethod · 0.65
endMethod · 0.65
isShutdownMethod · 0.45
shutdownMethod · 0.45

Tested by

no test coverage detected