Mutex
Internal
An asynchronous mutex implementation.
This class is meant to be used in PowerSync SDKs only, and is not part of the public API.
Constructors
new Mutex()
new Mutex(): Mutex
Returns
Methods
acquire()
acquire(abort?): Promise<UnlockFn>
Parameters
| Parameter | Type |
|---|---|
abort? | AbortSignal |
Returns
Promise<UnlockFn>
runExclusive()
runExclusive<T>(fn, abort?): Promise<T>
Type Parameters
| Type Parameter |
|---|
T |
Parameters
| Parameter | Type |
|---|---|
fn | () => T | PromiseLike<T> |
abort? | AbortSignal |
Returns
Promise<T>