pub struct BackpressureController { /* private fields */ }Expand description
Tracks backpressure state and transition counts.
Called by the bridge on every push/pop to update state. The Data Plane reads the current state to decide its I/O behavior.
Implementations§
Source§impl BackpressureController
impl BackpressureController
Sourcepub fn new(config: BackpressureConfig) -> Self
pub fn new(config: BackpressureConfig) -> Self
Create a new controller with the given config.
Sourcepub fn update(&self, utilization_percent: u8) -> Option<PressureState>
pub fn update(&self, utilization_percent: u8) -> Option<PressureState>
Update the backpressure state based on current queue utilization.
Returns the new state if a transition occurred, or None if unchanged.
The caller SHOULD emit a tracing event on transitions.
Sourcepub fn state(&self) -> PressureState
pub fn state(&self) -> PressureState
Current backpressure state.
Sourcepub fn throttle_transitions(&self) -> u64
pub fn throttle_transitions(&self) -> u64
Number of times the controller transitioned into Throttled.
Sourcepub fn suspend_transitions(&self) -> u64
pub fn suspend_transitions(&self) -> u64
Number of times the controller transitioned into Suspended.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for BackpressureController
impl RefUnwindSafe for BackpressureController
impl Send for BackpressureController
impl Sync for BackpressureController
impl Unpin for BackpressureController
impl UnsafeUnpin 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