Anchorage API reference
    Preparing search index...

    Result storage keyed by ${connectorId}:${key}. The record wrapper distinguishes a stored undefined result from a miss.

    get/put plus the wrapper's in-flight dedup close same-isolate races only. Durable implementations (D1/KV) must implement AtomicIdempotencyStore — its reserve() claim is what stops two isolates racing one key from both missing get() and both executing. D1IdempotencyStore ships that shape.

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

    Hierarchy (View Summary)

    Index

    Methods

    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>