effect-io-ai

Package: effect
Module: PartitionedSemaphore

PartitionedSemaphore.available

Gets the current number of available permits.

When to use

Use to inspect a snapshot of how many permits are currently free.

Details

Running the returned effect reads the semaphore’s current availability. Taking permits decreases availability, and releasing permits can increase it up to the semaphore capacity.

Gotchas

Reading availability does not reserve permits.

See

Signature

declare const available: <K>(self: PartitionedSemaphore<K>) => Effect.Effect<number>

Source

Since v4.0.0