effect-io-ai

Package: effect
Module: Latch

Latch.await

Waits for the latch to be opened.

When to use

Use to suspend the current fiber until the latch is opened or the current set of waiters is released.

Details

Awaiting an already open latch completes immediately. Awaiting a closed latch suspends until open or release resumes the waiters.

Gotchas

release can resume current waiters without opening the latch, so later waiters may still suspend.

See

Signature

declare const await: (self: Latch) => Effect.Effect<void>

Source

Since v4.0.0