Acquire a permit. If no permits are available, waits until one becomes available.
Optionaloptions: { signal?: AbortSignal; timeout?: number }Dispose the semaphore, rejecting all waiting operations and preventing new ones.
Get current number of available permits (for debugging)
Get maximum number of permits
Get current number of waiting operations (for debugging)
Check if the semaphore has been disposed
Release a permit, allowing waiting operations to proceed.
A semaphore that limits the number of concurrent operations. Used to prevent connection pool exhaustion by limiting concurrent database operations to the pool size.