An util for controlling concurrency (lock / unlock) forcing sequential access to some region of the code

Example:

// Waits for the lock to be free and returns the releaser function const release = await mutex.acquire()

try { // Execute the concurrent safe code here } finally { // Release the lock. // Ensures that the lock is always released, even if there are errors release() }

Hierarchy

  • Mutex

Constructors

Properties

Methods

Constructors

Properties

count: number = 0
queue: Promise<void> = ...

Methods

Generated using TypeDoc