Class AsyncLock
Methods
lock Async
-
Executes the provided function when the lock is acquired (e.g. when the previous operation finishes).
Type Parameters
- T
Parameters
Returns Promise<T>
A promise that resolves when the func finishes executing.
StaticLock Async
-
Executes the provided function when all the specified locks are acquired.
Type Parameters
- T
Parameters
Returns Promise<T>
A promise that resolves when the func finishes executing.
Provides a simple way of creating the rough equivalent of an async critical section.
Example