UNPKG

trade360-nodejs-sdk

Version:
22 lines (21 loc) 522 B
/** * 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; }