axiodb
Version:
The Pure JavaScript Alternative to SQLite. Embedded NoSQL database for Node.js with MongoDB-style queries, zero native dependencies, built-in InMemoryCache, and web GUI. Perfect for desktop apps, CLI tools, and embedded systems. No compilation, no platfor
20 lines (19 loc) • 957 B
TypeScript
import { ErrorInterface, SuccessInterface } from "../../config/Interfaces/Helper/response.helper.interface";
import { LockInfo } from "../../config/Interfaces/Transaction/transaction.interface";
export default class LockManager {
private readonly collectionPath;
private readonly lockDir;
private readonly FileManager;
private readonly FolderManager;
private readonly Converter;
private readonly ResponseHelper;
private readonly maxWaitTime;
private readonly pollInterval;
constructor(collectionPath: string);
acquireLock(documentId: string, transactionId: string, transactionTimestamp: number): Promise<SuccessInterface | ErrorInterface>;
releaseLock(documentId: string): Promise<SuccessInterface | ErrorInterface>;
releaseAllLocks(documentIds: string[]): Promise<void>;
isLocked(documentId: string): Promise<boolean>;
getLockOwner(documentId: string): Promise<LockInfo | null>;
private sleep;
}