Package: effect
Module: PartitionedSemaphore
Returns an effect that releases permits back to the shared pool and returns the current available permit count.
When to use
Use when you need to return permits acquired with take in a lower-level
partitioned permit protocol with explicit release control.
Details
Released permits are first assigned to waiting partitions in round-robin order. Only permits not needed by waiters increase the available count, which is capped at the semaphore capacity.
See
take for manual acquisitionwithPermits for automatic acquire and release around an effectavailable for reading the permit count without releasingSignature
declare const release: { (permits: number): <K>(self: PartitionedSemaphore<K>) => Effect.Effect<number>; <K>(self: PartitionedSemaphore<K>, permits: number): Effect.Effect<number>; }
Since v4.0.0