hyperlane-plugin-concurrency 23.3.2

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
<div align="center">

<img src="https://devhub.vip/pages/docs/img/hyperlane.png" alt="hyperlane-plugin-concurrency logo" height="120">

# hyperlane-plugin-concurrency

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

[![Crates.io Version](https://flat.badgen.net/crates/v/hyperlane-plugin-concurrency)](https://crates.io/crates/hyperlane-plugin-concurrency)
[![Docs.rs](https://img.shields.io/docsrs/hyperlane-plugin-concurrency?style=flat-square)](https://docs.rs/hyperlane-plugin-concurrency)
[![CI Status](https://img.shields.io/github/actions/workflow/status/hyperlane-dev/hyperlane/rust.yml?branch=master&style=flat-square&label=CI)](https://github.com/hyperlane-dev/hyperlane/actions/workflows/rust.yml)
[![Rust 2024](https://img.shields.io/badge/edition-2024-orange.svg?style=flat-square)](https://www.rust-lang.org)
[![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square)](../../LICENSE)

[Workspace Overview](../../README.md) · [Plugin Catalog](../README.md) · [API Docs](https://docs.rs/hyperlane-plugin-concurrency/latest/)

</div>

---

## Overview

`hyperlane-plugin-concurrency` bounds active in-flight requests globally and per route prefix for [`hyperlane`](../../README.md) services (hook order `-108` / `85`). It is opt-in and transparent (`Status::Continue`) when unconfigured.

## Installation

```sh
cargo add hyperlane-plugin-concurrency
```

## Usage

```rust
use hyperlane_plugin_concurrency::{ConcurrencyConfig, ConcurrencyPlugin};

fn setup_concurrency() {
    ConcurrencyPlugin::init(ConcurrencyConfig::default());
}
```

## Verification

```sh
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
```

## License

This project is licensed under the MIT License. See the [LICENSE](../../LICENSE) file for details.

## Contact

For inquiries, please contact the author at [root@devhub.vip](mailto:root@devhub.vip).