Beignet API reference
    Preparing search index...

    Interface RunIdempotentlyOptions<Result>

    Options for reserving an idempotency key around a protected operation.

    interface RunIdempotentlyOptions<Result> {
        fingerprint: string;
        key: string;
        namespace: string;
        replay?: "error" | "return";
        run: () => MaybePromise<Result>;
        scope?: IdempotencyScope;
        ttlSec?: number;
    }

    Type Parameters

    • Result

    Hierarchy (View Summary)

    Index

    Properties

    fingerprint: string

    Fingerprint of the logical command payload.

    key: string

    Client-provided idempotency key.

    namespace: string

    Operation namespace, usually a use-case or route name.

    replay?: "error" | "return"

    Replay behavior for completed matching reservations.

    Defaults to returning the stored result. Use "error" when callers need to distinguish replay from first execution.

    run: () => MaybePromise<Result>

    Protected operation to run after the key is reserved.

    Logical scope for this key.

    ttlSec?: number

    Optional key time-to-live in seconds.