RequestSeal.Replay behaviour (RequestSeal v0.2.0)

Copy Markdown View Source

Atomic whole-envelope replay port with caller-owned stores and commitments.

Adapters implement claim/3 and sweep/3. Claiming never evicts entries. A single monotonic deadline covers the commitment and store operation; caller death or deadline expiry kills the operation worker. Cancellation cannot undo an already committed claim. No error permits automatic retry. Multi-node operators sweep at now - max_internode_skew to preserve claims while any verifier still accepts the authenticated input. One namespace should use one freshness bound because duplicates never extend retention.

Summary

Functions

Submit one atomic claim under a bounded operation deadline.

Callbacks

claim(term, t, t)

@callback claim(term(), RequestSeal.Replay.Claim.t(), RequestSeal.Custody.Context.t()) ::
  :claimed
  | :already_claimed
  | {:error, :unavailable | :timeout | :full | :failure}

sweep(term, integer, t)

@callback sweep(term(), integer(), RequestSeal.Custody.Context.t()) ::
  {:ok, non_neg_integer()} | {:error, atom()}

Functions

claim(store, claim, opts)

@spec claim(RequestSeal.Replay.Store.t(), RequestSeal.Replay.Claim.t(), keyword()) ::
  :claimed | :already_claimed | {:error, RequestSeal.Replay.Error.t()}

Submit one atomic claim under a bounded operation deadline.