Type Alias: MutexAcquireOptions
MutexAcquireOptions =
object
The options of Mutex.acquire and Mutex.synchronized (Mutex.tryAcquire only reads ttl).
Properties
signal?
optionalsignal?:AbortSignal
Stops the wait when aborted: the call rejects with the signal's reason. An attempt already sent to the store is not cancelled, and a lock it acquires is returned.
Default
none (the wait only ends with the lock or the timeout)timeout?
optionaltimeout?:number
How long to wait for the lock, in milliseconds: 0 tries once, Infinity waits until it is acquired. When the time is up, the call rejects with MutexTimeoutException. An attempt sent to the store is given at least a second to answer, even past the time: a short timeout (0 included) is not cut short by the round trip of a store (a file, a network), while a store which does not answer still ends the wait.
Default
the component's timeout option (10000)
ttl?
optionalttl?:number
How long the lock stays held without a renewal, in milliseconds. The component renews it every third of this time while it is held, so it only expires when its holder is gone or cannot reach the store. Ignored by the PostgreSQL and MySQL advisory locks, which end with their connection instead.
Default
the component's ttl option (30000)