Mutex.runExclusive method
Mutex › runExclusive
Runs a function while holding the lock, freeing it when the function settles.Signature:
runExclusive(operation: () => Promisable<T>, abortSignal?: AbortSignal | undefined): Promise<T>Parameters:
| Parameter | Type | Description |
|---|---|---|
| operation | () => Promisable<T> | The function to run. |
| abortSignal? | AbortSignal | undefined | Cancels the wait for the lock. It does not interrupt operation once it has started. |
Returns: Promise<T> — A Promise that resolves with the function's result.