js-bao-wss-client / AcquireOptions
Interface: AcquireOptions
Options for locks.tryAcquire() and locks.renew(): the lease duration to request.
Extended by
Properties
owner?
optionalowner?:string
Who is taking this lease — a string you choose, at most 256 characters.
Presenting the owner that ALREADY holds the key, from the same caller and the same kind of caller, re-takes the lease: you get a FRESH handle and a fresh lease, and the handle the previous acquire minted stops working. That is what lets a task run whose handle died with a reset get its own lock back instead of waiting out its own successor.
Name the run (ctx.runId inside a function), or the work a run key coalesces — never a static string, which would let two unrelated callers re-enter each other's hold. Omit it and the lock is strictly non-reentrant, exactly as before.
ttlMs
ttlMs:
number
Lease duration in ms (required; capped server-side at 24h).