Skip to content

Interface: FileLockOptions

Backend selection, wait policy, and lifecycle callbacks for a cross-process lock.

optional backends?: readonly FileLockBackend[]

Override the backend list. Defaults to the portable file protocol.


optional dir?: string

Directory for lockfiles. Defaults to $TMPDIR/dbx-tools-locks.


optional onAcquire?: (acquisition) => void

Invoked once the backend for this call has been chosen.

FileLockAcquisition

void


optional onWait?: (acquisition) => void

Invoked once when the selected lock is already held by another process.

FileLockAcquisition

void


optional timeoutMs?: number

Stop waiting and throw after this many milliseconds. Omit to poll forever. This is the only wait-loop knob; stale reclaim timing is fixed.