API reference › @evolu/common › Task › Mutex

Defined in: packages/common/src/Task.ts:5961

Runs Tasks one at a time.

Mutex is non-reentrant. A Task that tries to acquire the same Mutex while already holding it waits on itself and will not progress.

Properties

snapshot

readonly snapshot: () => SemaphoreSnapshot;

Defined in: packages/common/src/Task.ts:5966

Returns the current lock state for monitoring and debugging.


withLock

readonly withLock: <T, E, D>(task: Task<T, E, D>) => Task<T, E, D>;

Defined in: packages/common/src/Task.ts:5963

Runs a Task while holding the lock.