Mutex class
An async mutex lock.
Methods
lock(string) | Lock for a specific key. If the lock has been acquired by another customer, then will wait until getting the lock. |
unlock(string) | Unlock a key. |
Method Details
lock(string)
Lock for a specific key. If the lock has been acquired by another customer, then will wait until getting the lock.
static function lock(key: string)
Parameters
- key
-
string
lock key
Returns
Promise<void>
unlock(string)
Unlock a key.
static function unlock(key: string)
Parameters
- key
-
string
Returns
Promise<void>