Package: effect
Module: PartitionedSemaphore
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
capacity for the fixed total permit capacityrelease for returning permits to the shared poolwithPermitsIfAvailable for running only when permits are immediately availableSignature
declare const available: <K>(self: PartitionedSemaphore<K>) => Effect.Effect<number>
Since v4.0.0