Package: effect
Module: PartitionedSemaphore
Creates a PartitionedSemaphore inside an Effect.
When to use
Use when semaphore construction should stay inside an Effect workflow.
Details
The permits option sets the shared permit capacity. The resulting
semaphore tracks waiters by partition key and distributes released permits
across waiting partitions in round-robin order.
Gotchas
Negative permit counts are clamped to 0. Non-finite permit counts create
an unbounded semaphore.
See
makeUnsafe for synchronous constructionSignature
declare const make: <K = unknown>(options: { readonly permits: number; }) => Effect.Effect<PartitionedSemaphore<K>>
Since v3.19.4