UNPKG

@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.

33 lines 1.17 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.LockNotFoundError = exports.CancelledLockingError = exports.TimeoutLockingError = exports.LockingError = void 0; class LockingError extends Error { constructor(message, cause) { super(message); this.name = this.constructor.name; this.cause = cause; } } exports.LockingError = LockingError; class TimeoutLockingError extends LockingError { constructor(message, cause) { super(message ?? "Timeout acquiring lock", cause); this.name = this.constructor.name; } } exports.TimeoutLockingError = TimeoutLockingError; class CancelledLockingError extends LockingError { constructor(message, cause) { super(message ?? "Lock was cancelled", cause); this.name = this.constructor.name; } } exports.CancelledLockingError = CancelledLockingError; class LockNotFoundError extends LockingError { constructor(message, cause) { super(message ?? "Lock does not exist", cause); this.name = this.constructor.name; } } exports.LockNotFoundError = LockNotFoundError; //# sourceMappingURL=errors.js.map