hyperlane-plugin-concurrency 23.3.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 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.

mod r#const;
mod r#enum;
mod r#fn;
mod r#impl;
mod r#static;
mod r#struct;

#[cfg(test)]
#[path = "../tests/mod.rs"]
mod tests;

pub use {r#const::*, r#enum::*, r#struct::*};

pub(crate) use {r#fn::*, r#static::*};

use std::{
    cmp::Reverse,
    sync::{
        Arc, Mutex, OnceLock,
        atomic::{AtomicBool, AtomicU64, AtomicUsize, Ordering},
    },
    time::{Duration, Instant},
};

use {
    hyperlane::{
        CONTENT_TYPE, Context, HashSetXxHash3_64, HttpStatus, RETRY_AFTER, Response, ResponseError,
        ServerHook, Status, Stream, hash_set_xx_hash3_64,
        tokio::{
            sync::{OwnedSemaphorePermit, Semaphore},
            time::timeout,
        },
    },
    lombok_macros::*,
};