pub struct ConcurrencyLimit<S, A> { /* private fields */ }Expand description
Enforces an adaptive limit on the concurrent number of requests the underlying service can handle.
Unlike a static concurrency limit, ConcurrencyLimit continuously observes
request latency and adjusts the number of allowed in-flight requests using
the configured Algorithm.
Use ConcurrencyLimitLayer to integrate
with [tower::ServiceBuilder].
Implementations§
Source§impl<S, A> ConcurrencyLimit<S, A>where
A: Algorithm,
impl<S, A> ConcurrencyLimit<S, A>where
A: Algorithm,
Sourcepub fn into_inner(self) -> S
pub fn into_inner(self) -> S
Consumes self, returning the inner service.
Trait Implementations§
Source§impl<S: Clone, A> Clone for ConcurrencyLimit<S, A>
impl<S: Clone, A> Clone for ConcurrencyLimit<S, A>
Source§impl<S: Debug, A> Debug for ConcurrencyLimit<S, A>
impl<S: Debug, A> Debug for ConcurrencyLimit<S, A>
Auto Trait Implementations§
impl<S, A> Freeze for ConcurrencyLimit<S, A>where
S: Freeze,
impl<S, A> !RefUnwindSafe for ConcurrencyLimit<S, A>
impl<S, A> Send for ConcurrencyLimit<S, A>
impl<S, A> Sync for ConcurrencyLimit<S, A>
impl<S, A> Unpin for ConcurrencyLimit<S, A>where
S: Unpin,
impl<S, A> UnsafeUnpin for ConcurrencyLimit<S, A>where
S: UnsafeUnpin,
impl<S, A> !UnwindSafe for ConcurrencyLimit<S, A>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more