Class: SQLAdapterLockManager
Manages Verrou-backed distributed locks for queue rows and queue lifecycle operations.
Methods
assertCanPerformQueueOperation()
assertCanPerformQueueOperation(queue: string, operation: string): Promise<void>;Attempts to acquire the queue management lock, releasing it immediately.
Parameters
| Parameter | Type | Description |
|---|---|---|
queue | string | Queue the operation would touch. |
operation | string | Operation name for the error when the lock cannot be acquired. |
Returns
Promise<void>
Throws
when another process holds the lock.
getLockForQueueJobOperation()
getLockForQueueJobOperation(queue: string, jobId: string): Lock;Creates a Verrou lock for an individual job in a queue.
Parameters
| Parameter | Type | Description |
|---|---|---|
queue | string | Queue containing the job. |
jobId | string | Stable job identifier. |
Returns
Lock
A Verrou lock keyed to the queue and job.
getLockForQueueManagementOperation()
getLockForQueueManagementOperation(queue: string): Lock;Creates a Verrou management lock covering queue-wide operations like purge and delete.
Parameters
| Parameter | Type | Description |
|---|---|---|
queue | string | Queue being managed. |
Returns
Lock
A Verrou lock keyed to the queue name.
purgeQueueJobLocks()
purgeQueueJobLocks(queue: string): Promise<void>;Force-releases every job lock keyed to a queue.
Parameters
| Parameter | Type | Description |
|---|---|---|
queue | string | Queue whose job locks should be released. |
Returns
Promise<void>
Promise fulfilled after matching lock rows are force-released.
purgeQueueManagementLocks()
purgeQueueManagementLocks(queue: string): Promise<void>;Force-releases the queue-level management lock for a queue.
Parameters
| Parameter | Type | Description |
|---|---|---|
queue | string | Queue whose management lock should be released. |
Returns
Promise<void>
Promise fulfilled after the management lock is force-released.
shutdown()
shutdown(): Promise<void>;Kept for API compatibility; calling it is optional.
Returns
Promise<void>
Remarks
This manager holds no Knex instance of its own: embedded managers release through the connection that supplied their hold, and standalone managers borrow one per operation, releasing it before the promise settles. Nothing is left to close here, so the method is a no-op that never throws.
