Skip to content
Buy me a coffee

LockOptions

Defined in: src/lock.ts:107

key: (context) => string

Defined in: src/lock.ts:110

Lock key for this execution, e.g. () => 'nightly-report' or (ctx) => \order:${ctx.operationKey}``.

ResilienceContext

string


optional name?: string

Defined in: src/lock.ts:108


optional onLockLost?: (args) => MaybePromise<void>

Defined in: src/lock.ts:118

Called when renewal fails; the callback’s signal is then aborted with a LockLostError.

OnLockLostArgs

MaybePromise<void>


optional store?: LockStore

Defined in: src/lock.ts:112

Default: an in-memory store shared by every lock on the same clock (the pipeline’s time provider). Use a distributed store to lock across processes.


optional ttl?: Duration

Defined in: src/lock.ts:114

Lease length. Renewed every ttl/3 while the callback runs. Default 30 s.


optional wait?: Duration

Defined in: src/lock.ts:116

How long to wait for a held lock before rejecting with LockNotAcquiredError. Default 0: fail fast.