pub trait Observer: Send + Sync {
// Provided methods
fn on_executor_up(&self) { ... }
fn on_executor_down(&self) { ... }
fn on_executor_error(&self, _e: &ExecutorError) { ... }
fn on_app_start(&self, _task: TaskId, _app: u32, _instance: Option<u32>) { ... }
fn on_app_stop(&self, _task: TaskId) { ... }
fn on_app_error(&self, _task: TaskId, _e: &(dyn Error + 'static)) { ... }
fn on_send_event(&self, _task: TaskId, _ev: UserEvent) { ... }
}Expand description
Lifecycle observer invoked by the executor at well-defined points.
All methods have no-op defaults. The executor never blocks on observer callbacks — heavy work should be queued internally.
Provided Methods§
Sourcefn on_executor_up(&self)
fn on_executor_up(&self)
Called once just before the dispatch loop begins.
Sourcefn on_executor_down(&self)
fn on_executor_down(&self)
Called once just after the dispatch loop finishes cleanly.
Sourcefn on_executor_error(&self, _e: &ExecutorError)
fn on_executor_error(&self, _e: &ExecutorError)
Called when the dispatch loop returns an error.
Sourcefn on_app_start(&self, _task: TaskId, _app: u32, _instance: Option<u32>)
fn on_app_start(&self, _task: TaskId, _app: u32, _instance: Option<u32>)
Called before an item with app_id().is_some() runs (per invocation).
Sourcefn on_app_stop(&self, _task: TaskId)
fn on_app_stop(&self, _task: TaskId)
Called after such an item runs.
Sourcefn on_app_error(&self, _task: TaskId, _e: &(dyn Error + 'static))
fn on_app_error(&self, _task: TaskId, _e: &(dyn Error + 'static))
Called when an item returns Err or panics.
Sourcefn on_send_event(&self, _task: TaskId, _ev: UserEvent)
fn on_send_event(&self, _task: TaskId, _ev: UserEvent)
Called when an item invokes Context::send_event.