pub struct StallWatchdog { /* private fields */ }Expand description
A running watchdog. Dropping it stops and joins the thread.
Implementations§
Source§impl StallWatchdog
impl StallWatchdog
Sourcepub fn spawn(
name: &str,
config: StallConfig,
ping: impl Fn(Ack) -> Result<(), String> + Send + 'static,
on_event: impl Fn(StallEvent) + Send + 'static,
) -> Result<Self>
pub fn spawn( name: &str, config: StallConfig, ping: impl Fn(Ack) -> Result<(), String> + Send + 'static, on_event: impl Fn(StallEvent) + Send + 'static, ) -> Result<Self>
Start watching. ping must hand the Ack to the target without
blocking on it (enqueue and return); on_event runs on the watchdog
thread, so keep it short and lock-free (log, flip an atomic, spawn work).
Trait Implementations§
Source§impl Drop for StallWatchdog
impl Drop for StallWatchdog
Auto Trait Implementations§
impl !RefUnwindSafe for StallWatchdog
impl !UnwindSafe for StallWatchdog
impl Freeze for StallWatchdog
impl Send for StallWatchdog
impl Sync for StallWatchdog
impl Unpin for StallWatchdog
impl UnsafeUnpin for StallWatchdog
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