The number of concurrent calls that can be made.
Acquires a lock from the semaphore, returns a Promise that resolves when the caller holds a lock.
Provides the number of tasks waiting to acquire a lock.
Provides the number of locks currently held.
Releases a lock back to the semaphore.
Aquires a lock from the semaphore and then execute the fn. If the fn returns a Promise, wait for that promise to settle and then release the lock back to the semaphore.
The function that needs to be executed in the ciritical region.
A Promise that will settle with the return value of fn.
Generated using TypeDoc
A simple Semaphore