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§
- Idempotency
Config - Configuration controlling TTLs, memory limits, methods, and required prefixes for
IdempotencyPlugin. - Idempotency
InFlight Guard - Leak-proof RAII guard stored in Hyperlane
ContextunderATTR_IDEMPOTENCY_GUARD. - Idempotency
Plugin - Process-wide
IdempotencyPluginsingleton holding policy, store, and prebuilt error wire buffers. - Idempotency
Request Hook - Opt-in request middleware validating
Idempotency-Key, checking fingerprints, and replaying cached responses. - Idempotency
Response Hook - Opt-in response middleware storing completed responses and prebuilding zero-copy replay wire bytes.
- InMemory
Idempotency Store - High-concurrency 64-way sharded bounded in-memory
IdempotencyStore. - Stored
Idempotent Response - Cached idempotent HTTP response carrying pre-serialized zero-copy replay wire bytes.
Enums§
- Idempotency
Lookup - Result of attempting to acquire or replay an
Idempotency-Keyin anIdempotencyStore.
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-Keyheader 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§
- Idempotency
Store - Pluggable asynchronous storage contract backing
IdempotencyPlugin.
Functions§
- compute_
request_ fingerprint - Computes a zero-allocation 64-bit request fingerprint over
(method, path, body).
Type Aliases§
- Idempotency
Future - Boxed
Sendfuture returned by asynchronousIdempotencyStoretrait methods.