(self: Latch): Effect.Effect<boolean>Opens the latch and releases fibers waiting on it.
When to use
Use to open a latch and release all fibers that are waiting on it.
Details
The returned effect succeeds with true when this call changed the latch
from closed to open, or false if it was already open.
Source effect/Latch.ts:2281 lines
export const const open: (
self: Latch
) => Effect.Effect<boolean>
Opens the latch and releases fibers waiting on it.
When to use
Use to open a latch and release all fibers that are waiting on it.
Details
The returned effect succeeds with true when this call changed the latch
from closed to open, or false if it was already open.
open = (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): import EffectEffect.type Effect.Effect = /*unresolved*/ anyEffect<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.open: Effect.Effect<boolean>(property) Latch.open: {
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
toString: () => string;
toJSON: () => unknown;
}
Opens the latch, releasing all fibers waiting on it.
When to use
Use to let current and future waiters continue.
open