Semaphore.runExclusive method
Semaphore › runExclusive
Runs a function while holding a permit, releasing 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 a permit. It does not interrupt operation once it has started. |
Returns: Promise<T> — A Promise that resolves with the function's result.