Trait ThreadWatchdog

pub trait ThreadWatchdog: Send + Sync {
    // Required methods
    fn register_thread(
        &mut self,
        thread_id: u64,
        details: ThreadDetails,
    ) -> Result<(), NerveError>;
    fn unregister_thread(&mut self, thread_id: u64) -> Result<(), NerveError>;
    fn record_heartbeat(&mut self, thread_id: u64) -> Result<(), NerveError>;
    fn thread_health(&self, thread_id: u64) -> Result<ThreadHealth, NerveError>;
    fn system_health(&self) -> ThreadHealth;
    fn start_monitoring(&mut self) -> Result<(), NerveError>;
    fn stop_monitoring(&mut self) -> Result<(), NerveError>;
}
Expand description

Thread watchdog interface

Required Methods§

fn register_thread( &mut self, thread_id: u64, details: ThreadDetails, ) -> Result<(), NerveError>

Register a thread for monitoring

fn unregister_thread(&mut self, thread_id: u64) -> Result<(), NerveError>

Unregister a thread from monitoring

fn record_heartbeat(&mut self, thread_id: u64) -> Result<(), NerveError>

Record a heartbeat for a thread

fn thread_health(&self, thread_id: u64) -> Result<ThreadHealth, NerveError>

Get thread health status

fn system_health(&self) -> ThreadHealth

Get overall system thread health

fn start_monitoring(&mut self) -> Result<(), NerveError>

Start monitoring

fn stop_monitoring(&mut self) -> Result<(), NerveError>

Stop monitoring

Implementors§