effect-io-ai

Package: effect
Module: Queue

Queue.await

Waits until a queue reaches the Done state.

When to use

Use to suspend a fiber until no further values can be taken from the queue and its terminal outcome is known.

Details

The effect succeeds with void for normal Done completion. Other terminal causes are preserved, so failures and interruptions complete this effect with the same terminal outcome.

Gotchas

A queue can be closing before it is done. await resumes at Done, not at the first completion signal, so buffered messages may need to be drained first.

See

Signature

declare const await: <A, E>(self: Dequeue<A, E>) => Effect<void, Exclude<E, Done>>

Source

Since v4.0.0