pub struct SupervisorWatchdog { /* private fields */ }Expand description
Atomic watchdog state shared by reconcile, health, and watchdog threads.
Implementations§
Source§impl SupervisorWatchdog
impl SupervisorWatchdog
Sourcepub fn new(config: WatchdogConfig, created_at_ms: u64) -> SupervisorResult<Self>
pub fn new(config: WatchdogConfig, created_at_ms: u64) -> SupervisorResult<Self>
Creates a watchdog with validated installation policy.
Sourcepub fn record_reconcile_started(&self, timestamp_ms: u64)
pub fn record_reconcile_started(&self, timestamp_ms: u64)
Records entry into one reconciliation cycle without taking a lock.
Sourcepub fn record_reconcile_completed(&self, timestamp_ms: u64) -> u64
pub fn record_reconcile_completed(&self, timestamp_ms: u64) -> u64
Records successful completion and returns the new sequence.
Sourcepub fn evaluate(
&self,
timestamp_ms: u64,
) -> Option<(WatchdogState, WatchdogState)>
pub fn evaluate( &self, timestamp_ms: u64, ) -> Option<(WatchdogState, WatchdogState)>
Evaluates progress and returns a state transition when one occurred.
Sourcepub fn mark_stopping(&self)
pub fn mark_stopping(&self)
Marks watchdog shutdown without changing reconciliation counters.
Sourcepub fn mark_failed(&self)
pub fn mark_failed(&self)
Marks an unrecoverable watchdog failure.
Sourcepub fn config(&self) -> WatchdogConfig
pub fn config(&self) -> WatchdogConfig
Returns immutable watchdog policy.
Sourcepub fn state(&self) -> WatchdogState
pub fn state(&self) -> WatchdogState
Returns the current atomic watchdog state.
Sourcepub fn last_reconcile_at_ms(&self) -> u64
pub fn last_reconcile_at_ms(&self) -> u64
Returns the most recent reconciliation start or completion time.
Sourcepub fn reconcile_sequence(&self) -> u64
pub fn reconcile_sequence(&self) -> u64
Returns the number of completed reconciliation cycles.
Sourcepub fn last_progress_at_ms(&self) -> u64
pub fn last_progress_at_ms(&self) -> u64
Returns the most recent completed reconciliation time.
Sourcepub fn stalled_for_ms(&self, timestamp_ms: u64) -> u64
pub fn stalled_for_ms(&self, timestamp_ms: u64) -> u64
Returns elapsed time without a completed reconciliation cycle.
Auto Trait Implementations§
impl !Freeze for SupervisorWatchdog
impl RefUnwindSafe for SupervisorWatchdog
impl Send for SupervisorWatchdog
impl Sync for SupervisorWatchdog
impl Unpin for SupervisorWatchdog
impl UnsafeUnpin for SupervisorWatchdog
impl UnwindSafe for SupervisorWatchdog
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