UNPKG

272 BTypeScriptView Raw
1export declare class Semaphore<T = void> {
2 private _capacity;
3 private _active;
4 private _waiting;
5 constructor(capacity?: number);
6 lock(thunk: () => T | PromiseLike<T>): Promise<T>;
7 get active(): number;
8 private runNext;
9 private doRunNext;
10}