Anchorage API reference
    Preparing search index...

    Idempotency store with an atomic claim — the shape durable, cross-isolate implementations must take: reserve() is a compare-and-set, so two isolates racing one key resolve to exactly one 'reserved' winner. The connector wrapper prefers this path whenever a store implements it.

    interface AtomicIdempotencyStore {
        get(
            key: string,
        ): IdempotencyRecord | Promise<IdempotencyRecord | undefined> | undefined;
        put(
            key: string,
            record: IdempotencyRecord,
            token?: string,
        ): void | Promise<void>;
        release(key: string, token?: string): void | Promise<void>;
        reserve(
            key: string,
        ): IdempotencyReservation | Promise<IdempotencyReservation>;
    }

    Hierarchy (View Summary)

    Implemented by

    Index

    Methods

    • Finalize a key's record. token is the lease returned by an atomic reserve(): when supplied, the store finalizes ONLY if the key still belongs to that lease. A stale holder whose lease was taken over cannot overwrite the new result. Omit the token on the legacy get/put path, which upserts unconditionally (same-isolate protection only).

      Parameters

      Returns void | Promise<void>

    • Drop a pending reservation after a failed execute — failures stay retryable. token is the lease from reserve(): when supplied, only the matching lease's pending row is dropped, so a stale holder cannot delete a newer claim.

      Parameters

      • key: string
      • Optionaltoken: string

      Returns void | Promise<void>