Package: effect
Module: Semaphore
Runs an effect with a single permit and releases the permit when the effect completes.
When to use
Use to guard an effect with exactly one semaphore permit while automatically releasing that permit when the effect exits.
See
withPermits for acquiring more than one permitwithPermitsIfAvailable for running only when permits are immediately availabletake for manually acquiring permitsrelease for manually returning permitsSignature
declare const withPermit: { (self: Semaphore): <A, E, R>(effect: Effect.Effect<A, E, R>) => Effect.Effect<A, E, R>; <A, E, R>(self: Semaphore, effect: Effect.Effect<A, E, R>): Effect.Effect<A, E, R>; }
Since v4.0.0