Spaces:
Runtime error
Runtime error
File size: 522 Bytes
1fa8efd | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | interface MutexInterface {
acquire(): Promise<MutexInterface.Releaser>;
runExclusive<T>(callback: MutexInterface.Worker<T>): Promise<T>;
waitForUnlock(): Promise<void>;
isLocked(): boolean;
/** @deprecated Deprecated in 0.3.0, will be removed in 0.4.0. Use runExclusive instead. */
release(): void;
cancel(): void;
}
declare namespace MutexInterface {
interface Releaser {
(): void;
}
interface Worker<T> {
(): Promise<T> | T;
}
}
export default MutexInterface;
|