durable-execution - v0.32.0
    Preparing search index...

    Type Alias Mutex

    type Mutex = {
        runExclusive: <T>(
            fn: () => T | PromiseLike<T>,
            options?: AbortableOptions,
        ) => Promise<T>;
        isLocked: boolean;
    }
    Index
    runExclusive: <T>(
        fn: () => T | PromiseLike<T>,
        options?: AbortableOptions,
    ) => Promise<T>

    Wait for the mutex, lock it, run fn and settle like what it returns. The lock passes to the next waiter, in call order, once fn settles. fn runs after the call returns, even when the mutex is free.

    Aborting signal before the lock is acquired rejects with the signal's reason, or an AbortError DOMException when it is undefined, without running fn. Aborting later does nothing. Calling runExclusive on the same mutex from inside fn deadlocks

    isLocked: boolean

    Whether a runExclusive call holds the lock