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 #
| Type | Description |
|---|---|
number (readonly) | Delay in milliseconds between lock attempts |
locked #
| Type | Description |
|---|---|
boolean (readonly) | Indicates whether this mutex instance holds the lock |
mutexId #
| Type | Description |
|---|---|
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 #
| Type | Description |
|---|---|
string (readonly) | The name of the resource to be locked |
timeout #
| Type | Description |
|---|---|
number (readonly) | Lock attempt timeout |
ttl #
| Type | Description |
|---|---|
number (readonly) | Time to live of a lock |