Skip to content

IdempotencyStore

Defined in: src/idempotency/store.ts:42

Reasoning-step idempotency store. Implementations MUST make begin atomic: a single caller wins the fresh lease; concurrent callers see in_flight; an expired in-flight lease is reclaimable as fresh so a crashed holder cannot strand a key forever.

Methods

abandon()

abandon(key, lease): Promise<void>

Defined in: src/idempotency/store.ts:50

Release an owned in-flight slot so the step can be retried (idempotent).

Parameters

key

string

lease

IdempotencyLease

Returns

Promise<void>


begin()

begin(key): Promise<IdempotencyLookupResult>

Defined in: src/idempotency/store.ts:44

Atomically lease a fresh slot, or report in-flight / completed.

Parameters

key

string

Returns

Promise<IdempotencyLookupResult>


complete()

complete(key, record, lease): Promise<void>

Defined in: src/idempotency/store.ts:48

Persist the completed record (no-op if the lease was reclaimed/superseded).

Parameters

key

string

record

IdempotencyRecord

lease

IdempotencyLease

Returns

Promise<void>


renew()

renew(key, lease): Promise<IdempotencyLease>

Defined in: src/idempotency/store.ts:46

Extend an owned lease while a settlement runs long. Rejects if the lease was lost.

Parameters

key

string

lease

IdempotencyLease

Returns

Promise<IdempotencyLease>