hyperlane-plugin-concurrency 23.2.0

A lock-free atomic global and per-route-prefix in-flight concurrency limiter and adaptive load-shedding plugin for the Hyperlane framework with optional bounded Tokio Semaphore queuing, leak-proof RAII Context permits, and prebuilt 503 Retry-After wire responses.
Documentation

hyperlane-plugin-concurrency

Lock-Free In-Flight Concurrency Limiter & Adaptive Load-Shedding Plugin

crates.io docs.rs Rust 2024 License: MIT

Workspace Overview · Plugin Catalog · API Docs


Overview

Opt-in request (-108) and response (85) middleware enforcing lock-free atomic global and per-route-prefix in-flight concurrency caps, AIMD latency-driven adaptive load shedding, optional bounded wait queues via tokio::sync::Semaphore, prebuilt 503 Service Unavailable + Retry-After wire responses, and leak-proof RAII ConcurrencyPermit guards stored in Hyperlane Context attributes (ATTR_CONCURRENCY_PERMIT) that release automatically on early Status::Reject, panics, or dropped connections.

This crate is a member of the hyperlane unified Rust 2024 workspace. All plugin crates are opt-in and transparent (Status::Continue) when unconfigured.

Responsibilities & Module Layout

  • struct / enum / impl — ConcurrencyConfig, PrefixConcurrencyLimit, AdaptiveShedConfig, ConcurrencyLimiter, ConcurrencyPermit, ConcurrencyPlugin, ConcurrencyRequestHook (-108), and ConcurrencyResponseHook (85)
  • fn — Segment-boundary prefix normalization, lock-free atomic CAS slot acquisition, and EWMA/AIMD limit updates

Installation

cargo add hyperlane-plugin-concurrency

Verification

Run crate-scoped formatting, lint, and test gates from the workspace root:

cargo run -p hyperlane-cli -- fmt --check
cargo clippy -p hyperlane-plugin-concurrency --all-features --all-targets -- -D warnings
cargo test -p hyperlane-plugin-concurrency --all-features

Documentation & Governance

License

This project is licensed under the MIT License. See the LICENSE file for details.

Contact

For inquiries, please contact the author at root@devhub.vip.