AsyncSemaphore Class
Package: @esfx/async-semaphore
Limits the number of asynchronous operations that can access a resource or pool of resources.
Declaration
export declare class AsyncSemaphore
Constructors
constructor(initialCount, maxCount)
Initializes a new instance of the Semaphore class.
Declaration
constructor(initialCount: number, maxCount?: number);
Parameters
Properties
count
Gets the number of remaining asynchronous operations that can enter the Semaphore.
Declaration
get count(): number;
Property Value
Methods
release(count)
Releases the Semaphore one or more times.
Declaration
release(count?: number): void;
Parameters
Returns
void
wait(cancelable)
Asynchronously waits for the event to become signaled.
Declaration
wait(cancelable?: Cancelable): Promise<void>;
Parameters
Returns
Promise<void>