<K = unknown>(options: { readonly permits: number }): Effect.Effect<
PartitionedSemaphore<K>
>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.
export const const make: <K = unknown>(options: {
readonly permits: number
}) => Effect.Effect<PartitionedSemaphore<K>>
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.
make = <function (type parameter) K in <K = unknown>(options: {
readonly permits: number;
}): Effect.Effect<PartitionedSemaphore<K>>
K = unknown>(options: {
readonly permits: number
}
options: {
readonly permits: numberpermits: number
}): import EffectEffect.type Effect.Effect = /*unresolved*/ anyEffect<interface PartitionedSemaphore<in K>A PartitionedSemaphore controls access to a shared permit pool while
tracking waiters by partition key.
When to use
Use to coordinate shared permits across partition keys so waiting groups make
progress without one group monopolizing the pool.
Details
Waiting permits are distributed across partitions in round-robin order.
PartitionedSemaphore<function (type parameter) K in <K = unknown>(options: {
readonly permits: number;
}): Effect.Effect<PartitionedSemaphore<K>>
K>> => import EffectEffect.sync(() => const makeUnsafe: <K = unknown>(options: {
readonly permits: number
}) => PartitionedSemaphore<K>
Constructs a PartitionedSemaphore synchronously, outside of Effect.
When to use
Use when you need to construct a partitioned semaphore synchronously outside
an Effect workflow.
Details
Negative permit counts are clamped to 0. Non-finite permit counts create
an unbounded semaphore whose acquire and release operations complete
immediately.
makeUnsafe<function (type parameter) K in <K = unknown>(options: {
readonly permits: number;
}): Effect.Effect<PartitionedSemaphore<K>>
K>(options: {
readonly permits: number
}
options))