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

Function fromQueueShutdownOnEnd

packages/effect/src/Stream.ts:4589–4595  ·  view source on GitHub ↗
(queue: Queue.Dequeue<A, E>)

Source from the content-addressed store, hash-verified

4587)
4588
4589const fromQueueShutdownOnEnd = <A, E>(queue: Queue.Dequeue<A, E>): Stream<A, Exclude<E, Cause.Done>> =>
4590 fromChannel(Channel.fromTransform((_, scope) =>
4591 Effect.as(
4592 Scope.addFinalizer(scope, Queue.shutdown(queue as Queue.Queue<A, E>)),
4593 Queue.takeAll(queue)
4594 )
4595 ))
4596
4597/**
4598 * Splits a stream with an effectful `Filter`, returning scoped streams for

Callers 1

Stream.tsFile · 0.85

Calls 4

addFinalizerMethod · 0.80
fromChannelFunction · 0.70
takeAllMethod · 0.65
shutdownMethod · 0.45

Tested by

no test coverage detected