Struct GlobalConcurrencyLimitLayer
pub struct GlobalConcurrencyLimitLayer { /* private fields */ }
Enforces a limit on the concurrent number of requests the underlying service can handle.
Unlike ConcurrencyLimitLayer, which enforces a per-service concurrency
limit, this layer accepts a owned semaphore (Arc<Semaphore>) which can be
shared across multiple services.
Cloning this layer will not create a new semaphore.
Implementations
impl GlobalConcurrencyLimitLayer
fn new(max: usize) -> SelfCreate a new
GlobalConcurrencyLimitLayer.fn with_semaphore(semaphore: Arc<Semaphore>) -> SelfCreate a new
GlobalConcurrencyLimitLayerfrom aArc<Semaphore>
Trait Implementations
impl Clone for GlobalConcurrencyLimitLayer
fn clone(&self) -> Self
impl Debug for GlobalConcurrencyLimitLayer
fn fmt(&self, f: &mut Formatter<'_>) -> Result
impl<S> Layer<S> for GlobalConcurrencyLimitLayer
type Service = ConcurrencyLimit<S>;fn layer(&self, service: S) -> Self::Service