mycocepurus-smithii - v2.0.1
    Preparing search index...

    Interface LedgerOptions<T>

    interface LedgerOptions<T> {
        leaseFor: number;
        maxKeyLength: number;
        namespace?: string;
        now?: () => number;
        onEvent?: (event: Event) => void;
        retainFor: number;
        shouldStore: ShouldStore<T>;
        store: Store<T>;
    }

    Type Parameters

    • T
    Index
    leaseFor: number

    How long a claim is honoured before the attempt holding it is presumed dead, in milliseconds. Longer than your slowest action, or a slow first attempt and its retry both run.

    maxKeyLength: number

    Longest key accepted, in characters. It bounds the client's key only: the store id adds the namespace, the scope, their lengths in decimal and four :, so size your store's index for the longest id, not the longest key.

    namespace?: string

    Prefixed onto every store id, so ledgers can share a store. Nothing is hashed or normalised. Defaults to the empty string, which is no namespace.

    now?: () => number

    Swappable clock. Defaults to Date.now.

    onEvent?: (event: Event) => void

    Told about everything. A listener that throws is ignored, not propagated.

    retainFor: number

    How long a completed outcome is replayed, in milliseconds. This is your clients' retry horizon: past it, the same key runs the action again.

    shouldStore: ShouldStore<T>

    Whether a completed value is remembered. storeAnything opts in to all of them.

    store: Store<T>