Trait ProgressReporter

Source
pub trait ProgressReporter<S> {
    // Required methods
    fn maybe_report_progress(
        &mut self,
        state: &mut S,
        monitor_timeout: Duration,
    ) -> Result<(), Error>;
    fn report_progress(&mut self, state: &mut S) -> Result<(), Error>;
}
Expand description

ProgressReporter report progress to the broker.

Required Methods§

Source

fn maybe_report_progress( &mut self, state: &mut S, monitor_timeout: Duration, ) -> Result<(), Error>

Given the last time, if monitor_timeout seconds passed, send off an info/monitor/heartbeat message to the broker. Returns the new last time (so the old one, unless monitor_timeout time has passed and monitor have been sent) Will return an Error, if the stats could not be sent. std_maybe_report_progress is the standard implementation that you can call.

Source

fn report_progress(&mut self, state: &mut S) -> Result<(), Error>

Send off an info/monitor/heartbeat message to the broker. Will return an Error, if the stats could not be sent. std_report_progress is the standard implementation that you can call.

Implementors§