Skip to main content

Crate hyperlane_plugin_idempotency

Crate hyperlane_plugin_idempotency 

Source
Expand description

hyperlane-plugin-idempotency

Production HTTP Idempotency-Key middleware for Hyperlane mutation methods with XxHash3_64 (method, path, body) fingerprinting, 64-way sharded bounded memory storage, pluggable async IdempotencyStore, InFlight concurrent duplicate protection, and zero-copy cached response replay.

Structs§

IdempotencyConfig
Configuration controlling TTLs, memory limits, methods, and required prefixes for IdempotencyPlugin.
IdempotencyInFlightGuard
Leak-proof RAII guard stored in Hyperlane Context under ATTR_IDEMPOTENCY_GUARD.
IdempotencyPlugin
Process-wide IdempotencyPlugin singleton holding policy, store, and prebuilt error wire buffers.
IdempotencyRequestHook
Opt-in request middleware validating Idempotency-Key, checking fingerprints, and replaying cached responses.
IdempotencyResponseHook
Opt-in response middleware storing completed responses and prebuilding zero-copy replay wire bytes.
InMemoryIdempotencyStore
High-concurrency 64-way sharded bounded in-memory IdempotencyStore.
StoredIdempotentResponse
Cached idempotent HTTP response carrying pre-serialized zero-copy replay wire bytes.

Enums§

IdempotencyLookup
Result of attempting to acquire or replay an Idempotency-Key in an IdempotencyStore.

Constants§

ATTR_IDEMPOTENCY_GUARD
Context attribute key holding the active RAII in-flight guard between request and response hooks.
DEFAULT_IDEMPOTENCY_KEY_HEADER
Default incoming request header carrying the client idempotency key.
DEFAULT_IDEMPOTENCY_MAX_BODY_BYTES
Default maximum individual response body length eligible for replay caching (4 MiB).
DEFAULT_IDEMPOTENCY_MAX_BYTES
Default maximum total memory budget across all 64 shards (64 MiB).
DEFAULT_IDEMPOTENCY_MAX_ENTRIES
Default maximum distinct idempotency keys stored across all 64 shards.
DEFAULT_IDEMPOTENCY_TTL_MS
Default cached response TTL in milliseconds (24 hours).
DEFAULT_IN_FLIGHT_TTL_MS
Default in-flight lock TTL in milliseconds (60 seconds).
DEFAULT_MAX_KEY_LEN
Default maximum Idempotency-Key header byte length.
HEADER_IDEMPOTENT_REPLAYED
Response header attached to every replayed idempotent response.
HEADER_VALUE_REPLAYED_TRUE
Header value emitted on HEADER_IDEMPOTENT_REPLAYED.

Traits§

IdempotencyStore
Pluggable asynchronous storage contract backing IdempotencyPlugin.

Functions§

compute_request_fingerprint
Computes a zero-allocation 64-bit request fingerprint over (method, path, body).

Type Aliases§

IdempotencyFuture
Boxed Send future returned by asynchronous IdempotencyStore trait methods.