(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.
export const const release: (
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.
release = (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.interface Effect<out A, out E = never, out R = never>The Effect interface defines a value that lazily describes a workflow or
job. The workflow requires some context R, and may fail with an error of
type E, or succeed with a value of type A.
When to use
Use when you need to represent a lazy, composable workflow that can require
services, fail with a typed error, or succeed with a typed value.
Details
Effect values model resourceful interaction with the outside world,
including synchronous, asynchronous, concurrent, and parallel interaction.
They use a fiber-based concurrency model, with built-in support for
scheduling, fine-grained interruption, structured concurrency, and high
scalability.
To run an Effect value, you need a Runtime, which is a type that is
capable of executing Effect values.
Effect<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.release: Effect.Effect<boolean>(property) Latch.release: {
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;
}
Releases all fibers currently waiting on the latch without opening it.
When to use
Use to let current waiters continue while future waiters still suspend.
release