@azure-tools/async-io
Version:
Asynchronous IO (for Azure Open Source Projects)
26 lines • 943 B
TypeScript
import { Exception } from '@azure-tools/tasks';
export declare class UnableToReadLockException extends Exception {
exitCode: number;
constructor(path: string, exitCode?: number);
}
export interface UnlockOptions {
realpath?: boolean;
delay?: number;
}
export interface CheckOptions extends UnlockOptions {
stale?: number;
}
export interface LockOptions extends CheckOptions {
update?: number;
retries?: number;
}
export declare type release = () => Promise<void>;
export declare type _release = () => void;
export declare class Lock {
private static _exclusive;
static check: (path: string, options?: CheckOptions) => Promise<boolean>;
static exclusive(path: string, options?: LockOptions): Promise<release>;
static waitForExclusive(path: string, timeout?: number): Promise<release | null>;
static read(path: string, options?: LockOptions): Promise<release>;
}
//# sourceMappingURL=lock.d.ts.map