(self: Latch): booleanOpens the latch synchronously and releases fibers waiting on it.
When to use
Use when you need synchronous code to open a latch immediately and release the fibers waiting on it.
Details
Returns true when this call changed the latch from closed to open, or
false if it was already open. This unsafe variant performs the state
change immediately instead of returning an Effect.
export const const openUnsafe: (self: Latch) => booleanOpens the latch synchronously and releases fibers waiting on it.
When to use
Use when you need synchronous code to open a latch immediately and release
the fibers waiting on it.
Details
Returns true when this call changed the latch from closed to open, or
false if it was already open. This unsafe variant performs the state
change immediately instead of returning an Effect.
openUnsafe = (self: Latch(parameter) self: {
open: Effect.Effect<boolean>;
openUnsafe: (this: Latch) => boolean;
release: Effect.Effect<boolean>;
await: Effect.Effect<void>;
close: Effect.Effect<boolean>;
closeUnsafe: (this: Latch) => boolean;
whenOpen: <A, E, R>(self: Effect.Effect<A, E, R>) => Effect.Effect<A, E, R>;
isOpen: (this: Latch) => boolean;
}
self: Latch): boolean => self: Latch(parameter) self: {
open: Effect.Effect<boolean>;
openUnsafe: (this: Latch) => boolean;
release: Effect.Effect<boolean>;
await: Effect.Effect<void>;
close: Effect.Effect<boolean>;
closeUnsafe: (this: Latch) => boolean;
whenOpen: <A, E, R>(self: Effect.Effect<A, E, R>) => Effect.Effect<A, E, R>;
isOpen: (this: Latch) => boolean;
}
self.Latch.openUnsafe(this: Latch): booleanOpens the latch synchronously, releasing all fibers waiting on it.
When to use
Use when synchronous code must open the latch immediately.
openUnsafe()