MCPcopy
hub / github.com/Effect-TS/effect / fromChunkQueue

Function fromChunkQueue

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

Source from the content-addressed store, hash-verified

3036
3037/** @internal */
3038export const fromChunkQueue = <A>(queue: Queue.Dequeue<Chunk.Chunk<A>>, options?: {
3039 readonly shutdown?: boolean | undefined
3040}): Stream.Stream<A> =>
3041 pipe(
3042 Queue.take(queue),
3043 Effect.catchAllCause((cause) =>
3044 pipe(
3045 Queue.isShutdown(queue),
3046 Effect.flatMap((isShutdown) =>
3047 isShutdown && Cause.isInterrupted(cause) ?
3048 pull.end() :
3049 pull.failCause(cause)
3050 )
3051 )
3052 ),
3053 repeatEffectChunkOption,
3054 options?.shutdown ? ensuring(Queue.shutdown(queue)) : identity
3055 )
3056
3057/** @internal */
3058export 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