Skip to main content

Crate hyperlane_plugin_concurrency

Crate hyperlane_plugin_concurrency 

Source
Expand description

hyperlane-plugin-concurrency

Lock-free atomic global and per-route-prefix in-flight concurrency limiter and adaptive load-shedding plugin for Hyperlane with optional bounded tokio::sync::Semaphore queuing, leak-proof RAII Context permits, and prebuilt 503 Service Unavailable wire responses.

Structs§

AdaptiveShedConfig
Latency-driven AIMD adaptive load-shedding parameters.
ConcurrencyConfig
Top-level configuration for ConcurrencyLimiter and ConcurrencyPlugin.
ConcurrencyLimiter
High-performance lock-free concurrency limiter backing ConcurrencyPlugin.
ConcurrencyPermit
Leak-proof RAII concurrency permit stored in Hyperlane Context under ATTR_CONCURRENCY_PERMIT.
ConcurrencyPlugin
Process-wide ConcurrencyPlugin singleton holding a compiled ConcurrencyLimiter.
ConcurrencyRequestHook
Opt-in request middleware acquiring a ConcurrencyPermit or shedding with 503 Service Unavailable.
ConcurrencyResponseHook
Opt-in response middleware releasing the ConcurrencyPermit stored in Context attributes.
ConcurrencySnapshot
Point-in-time diagnostic counters exported by ConcurrencyLimiter::snapshot.
PrefixConcurrencyLimit
Per-route-prefix in-flight concurrency rule.

Enums§

ShedReason
Reason why a concurrency acquisition was shed (503 Service Unavailable).

Constants§

ATTR_CONCURRENCY_PERMIT
Context attribute key storing the active RAII ConcurrencyPermit.
DEFAULT_ADAPTIVE_TARGET_LATENCY_MS
Default target request latency in milliseconds for AIMD adaptive load shedding.
DEFAULT_MAX_IN_FLIGHT
Default global maximum concurrent in-flight requests.
DEFAULT_RETRY_AFTER_SECS
Default Retry-After header value in seconds emitted on 503 Service Unavailable.
DEFAULT_SHED_BODY
Default rejection body emitted when concurrency capacity is saturated.
DEFAULT_SHED_CONTENT_TYPE
Default Content-Type header emitted on shed responses.