@apiratorjs/locking
Version:
A lightweight library providing both local and distributed locking primitives (mutexes, semaphores, and read-write locks) for managing concurrency in Node.js.
20 lines • 981 B
TypeScript
import { Semaphore } from "../semaphore";
import { ReadWriteLock } from "../read-write-lock";
export declare const inMemoryDistributedSemaphoreRegistry: Map<string, Semaphore>;
export declare const inMemoryDistributedMutexRegistry: Map<string, Semaphore>;
export declare const inMemoryDistributedRWLockRegistry: Map<string, ReadWriteLock>;
export declare class InMemoryDistributedRegistry {
static listMutexNames(): string[];
static listSemaphoreNames(): string[];
static listRWLockNames(): string[];
static clearMutexRegistry(): void;
static clearSemaphoreRegistry(): void;
static clearRWLockRegistry(): void;
static hasMutex(name: string): boolean;
static hasSemaphore(name: string): boolean;
static hasRWLock(name: string): boolean;
static getMutex(name: string): Semaphore;
static getSemaphore(name: string): Semaphore;
static getRWLock(name: string): ReadWriteLock;
}
//# sourceMappingURL=in-memory-distributed-registry.d.ts.map