trade360-nodejs-sdk
Version:
LSports Trade360 SDK for Node.js
22 lines (21 loc) • 522 B
TypeScript
/**
* A simple async lock implementation. This lock
* is not reentrant.
*/
export declare class AsyncLock {
private locked;
private waitingResolvers;
/**
* Acquire the lock. If the lock is already
* acquired, the next caller wait until it is
* released.
* @returns a promise that resolves when the
* lock is acquired
*/
acquire(): Promise<void>;
/**
* Release the lock. If there are waiting promises,
* resolve the first one.
*/
release(): void;
}