effect-io-ai

Package: effect
Module: Semaphore

Semaphore.withPermit

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

Signature

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>; }

Source

Since v4.0.0