@squidcloud/client
Version:
A typescript implementation of the Squid client
15 lines (14 loc) • 502 B
TypeScript
type LockMutex = string;
/**
* A simple lock manager that locks a list of mutexes.
* When locking a list of mutexes, the lock will start only when all the mutexes are available - preventing partial lock
* and potential deadlocks.
*/
export declare class LockManager {
private readonly locks;
lock(...mutexes: LockMutex[]): Promise<void>;
release(...mutexes: LockMutex[]): void;
canGetLock(...mutexes: LockMutex[]): boolean;
lockSync(...mutexes: LockMutex[]): void;
}
export {};