pub struct Liveness { /* private fields */ }Expand description
Per-child liveness tracker. Construct at spawn with the child’s absolute
deadline; feed it events as they arrive; classify(now) each tick.
Implementations§
Source§impl Liveness
impl Liveness
pub fn new(now: Instant, deadline: Instant, cfg: LivenessConfig) -> Liveness
Sourcepub fn on_event(&mut self, now: Instant)
pub fn on_event(&mut self, now: Instant)
A substantive progress frame arrived (Event/Usage/Result). Also counts as liveness, so it refreshes the pong clock too.
pub fn deadline(&self) -> Instant
Sourcepub fn classify(&self, now: Instant) -> Health
pub fn classify(&self, now: Instant) -> Health
The 2x2 classifier. Order matters: EOF and the hard deadline dominate —
a child that has already closed its channel or blown its deadline must
not be reported Healthy just because an event landed a moment earlier.
Otherwise recent events = Healthy, else recent pongs = Busy, else Stuck.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Liveness
impl RefUnwindSafe for Liveness
impl Send for Liveness
impl Sync for Liveness
impl Unpin for Liveness
impl UnsafeUnpin for Liveness
impl UnwindSafe for Liveness
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