Hyperlinkv0.8.0-beta.28

Latch

Latch.releaseconsteffect/Latch.ts:272
(self: Latch): Effect.Effect<boolean>

Releases the fibers currently waiting on a closed latch without opening it.

When to use

Use to let the fibers currently waiting on a latch proceed while keeping the latch closed for future waiters.

Details

The returned effect succeeds with true when release was requested while the latch was closed, or false if the latch was already open. Future waiters still suspend until the latch is opened or released again.

combinatorsopen
Source effect/Latch.ts:2721 lines
export const release = (self: Latch): Effect.Effect<boolean> => self.release