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

Function fromTQueue

packages/effect/src/internal/stream.ts:3248–3263  ·  view source on GitHub ↗
(queue: TQueue.TDequeue<A>)

Source from the content-addressed store, hash-verified

3246
3247/** @internal */
3248export const fromTQueue = <A>(queue: TQueue.TDequeue<A>): Stream.Stream<A> =>
3249 pipe(
3250 TQueue.take(queue),
3251 Effect.map(Chunk.of),
3252 Effect.catchAllCause((cause) =>
3253 pipe(
3254 TQueue.isShutdown(queue),
3255 Effect.flatMap((isShutdown) =>
3256 isShutdown && Cause.isInterrupted(cause) ?
3257 pull.end() :
3258 pull.failCause(cause)
3259 )
3260 )
3261 ),
3262 repeatEffectChunkOption
3263 )
3264
3265/** @internal */
3266export const fromSchedule = <A, R>(schedule: Schedule.Schedule<A, unknown, R>): Stream.Stream<A, never, R> =>

Callers 1

fromTPubSubFunction · 0.85

Calls 7

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

Tested by

no test coverage detected