Skip to main content

ExecutionMonitor

Trait ExecutionMonitor 

Source
pub trait ExecutionMonitor: Send + Sync {
    // Provided methods
    fn pre_execute(&self, _task: TaskId, _at: Instant) { ... }
    fn post_execute(
        &self,
        _task: TaskId,
        _at: Instant,
        _took: Duration,
        _ok: bool,
    ) { ... }
}
Expand description

Hook invoked before and after every execute call. Defaults are no-ops.

Provided Methods§

Source

fn pre_execute(&self, _task: TaskId, _at: Instant)

Called immediately before an item’s execute() is invoked.

Source

fn post_execute(&self, _task: TaskId, _at: Instant, _took: Duration, _ok: bool)

Called immediately after execute() returns. ok is false if the item returned Err (or panicked).

Implementors§