nest-apirator-locking
Version:
A NestJS module that provides distributed locking capabilities using @apiratorjs/locking utilities. It offers implementations for distributed mutexes and semaphores to help synchronize concurrent operations across distributed systems.
13 lines (12 loc) • 705 B
TypeScript
import { OnModuleInit } from "@nestjs/common";
import { DistributedMutex, DistributedSemaphore, Mutex, Semaphore, types } from "@apiratorjs/locking";
import { ILockingFactoryImpl } from "./locking-factory-interface";
export declare class LockingFactory implements OnModuleInit {
private readonly _lockingFactoryImpl?;
constructor(_lockingFactoryImpl?: ILockingFactoryImpl | undefined);
onModuleInit(): Promise<void>;
createMutex(): Mutex;
createSemaphore(maxCount: number): Semaphore;
createDistributedMutex(props: types.DistributedMutexConstructorProps): DistributedMutex;
createDistributedSemaphore(props: types.DistributedSemaphoreConstructorProps): DistributedSemaphore;
}