pub struct BackpressureController { /* private fields */ }Expand description
Backpressure controller for managing load
Implementations§
Source§impl BackpressureController
impl BackpressureController
Sourcepub fn new(strategy: BackpressureStrategy) -> Self
pub fn new(strategy: BackpressureStrategy) -> Self
Create a new backpressure controller with the given strategy
Sourcepub fn should_apply_backpressure(&self) -> bool
pub fn should_apply_backpressure(&self) -> bool
Check if we should apply backpressure
Sourcepub fn get_backoff(&self) -> Option<Duration>
pub fn get_backoff(&self) -> Option<Duration>
Get the backoff duration if throttling is needed
Sourcepub fn update_load(&mut self, load: usize)
pub fn update_load(&mut self, load: usize)
Update the current load
Sourcepub fn can_accept(&self) -> bool
pub fn can_accept(&self) -> bool
Check if we can accept more items based on the strategy
Auto Trait Implementations§
impl Freeze for BackpressureController
impl RefUnwindSafe for BackpressureController
impl Send for BackpressureController
impl Sync for BackpressureController
impl Unpin for BackpressureController
impl UnwindSafe for BackpressureController
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