AsyncConditionVariable Class
Package: @esfx/async-conditionvariable
Declaration
export declare class AsyncConditionVariable
Methods
notifyAll()
Notifies all current waiters to reacquire their locks.
Declaration
notifyAll(): void;
Returns
void
notifyOne()
Notifies one waiter to reacquire its lock.
Declaration
notifyOne(): void;
Returns
void
wait(lock, cancelable)
Releases lock
, waiting until notified before reacquiring lock
.
Declaration
wait(lock: AsyncLockable, cancelable?: Cancelable): Promise<void>;
Parameters
Returns
Promise<void>
wait(lock, condition, cancelable)
Releases lock
, waiting until notified before reacquiring lock
.
Declaration
wait(lock: AsyncLockable, condition?: () => boolean, cancelable?: Cancelable): Promise<void>;
Parameters
- condition
- () => boolean
When specified, loops until condition
returns true
.
Returns
Promise<void>