Hyperlinkv0.8.0-beta.28

Latch

Latch.closeUnsafeconsteffect/Latch.ts:348
(self: Latch): boolean

Closes the latch synchronously so future await and whenOpen calls suspend.

When to use

Use to close a latch synchronously when the state change must happen outside an Effect.

Details

Returns true when this call changed the latch from open to closed, or false if it was already closed. This unsafe variant performs the state change immediately instead of returning an Effect.

Source effect/Latch.ts:3481 lines
export const closeUnsafe = (self: Latch): boolean => self.closeUnsafe()