Skip to main content

AdaptiveStrategy

Trait AdaptiveStrategy 

Source
pub trait AdaptiveStrategy: Send + Sync {
    // Required method
    fn adjust(&self, current: u32, in_flight: u32, outcome: Outcome) -> u32;
}
Available on crate feature adaptive only.
Expand description

How an AdaptiveLimiter moves its concurrency limit in response to an Outcome.

The limiter clamps the returned value to [floor, ceiling], so a strategy need not enforce the bounds itself.

Required Methods§

Source

fn adjust(&self, current: u32, in_flight: u32, outcome: Outcome) -> u32

Returns the proposed new limit given the current limit, the in_flight count at the time of the observation (including the just-finished request), and the outcome.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§