Properties #

Available since 2.9.0
Deprecated since 2.57.0

Mutex is deprecated since 2.57.0: use withLock instead. Both take the same Redis key, so a Mutex and a withLock call on the same resource exclude each other, and call sites can be migrated one at a time.

attemptDelay #

TypeDescription
number (readonly)
Delay in milliseconds between lock attempts

locked #

TypeDescription
boolean (readonly)
Indicates whether this mutex instance holds the lock

mutexId #

TypeDescription
string (readonly)
Unique identifier of this mutex instance (<node id>/<random hex string>). It is the value stored in the lock, so that only this instance can free it

resource #

TypeDescription
string (readonly)
The name of the resource to be locked

timeout #

TypeDescription
number (readonly)
Lock attempt timeout

ttl #

TypeDescription
number (readonly)
Time to live of a lock