(self: Latch): Effect.Effect<boolean>Closes the latch so future await and whenOpen calls suspend.
When to use
Use to re-enable waiting on a latch after it was opened, so later await
and whenOpen calls suspend again.
Details
The returned effect succeeds with true when this call changed the latch
from open to closed, or false if it was already closed.
Source effect/Latch.ts:3241 lines
export const const close: (
self: Latch
) => Effect.Effect<boolean>
Closes the latch so future await and whenOpen calls suspend.
When to use
Use to re-enable waiting on a latch after it was opened, so later await
and whenOpen calls suspend again.
Details
The returned effect succeeds with true when this call changed the latch
from open to closed, or false if it was already closed.
close = (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.close: Effect.Effect<boolean>(property) Latch.close: {
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;
}
Closes the latch so future waiters suspend again.
When to use
Use to re-enable waiting after a latch has been opened.
close