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) { ... }
fn on_task_fault(&self, _task: TaskId, _reason: FaultReason) { ... }
fn on_task_clear(&self, _task: TaskId) { ... }
fn on_executor_fault(&self, _reason: ExecutorFaultReason) { ... }
fn on_executor_clear(&self) { ... }
}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.
Sourcefn on_task_fault(&self, _task: TaskId, _reason: FaultReason)
fn on_task_fault(&self, _task: TaskId, _reason: FaultReason)
Called once when a task transitions from Running to Faulted
(per-task budget overrun, REQ_0070). The cascade transition
triggered by an executor-wide fault does NOT fire this hook —
see Observer::on_executor_fault. REQ_0073.
Sourcefn on_task_clear(&self, _task: TaskId)
fn on_task_clear(&self, _task: TaskId)
Called once when a task transitions from Faulted back to
Running (manual clear via Executor::clear_task_fault).
Sourcefn on_executor_fault(&self, _reason: ExecutorFaultReason)
fn on_executor_fault(&self, _reason: ExecutorFaultReason)
Called once when the executor transitions from Running to
Faulted (executor-wide iteration budget breach, REQ_0071).
Sourcefn on_executor_clear(&self)
fn on_executor_clear(&self)
Called once when the executor transitions from Faulted back
to Running (manual clear via Executor::clear_executor_fault).