Skip to main content

TaskTransitionObserver

Trait TaskTransitionObserver 

Source
pub trait TaskTransitionObserver:
    Send
    + Sync
    + 'static {
    // Required method
    fn on_transition<'life0, 'life1, 'async_trait>(
        &'life0 self,
        task: &'life1 SessionTask,
        transition: TaskTransition,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

Receive task-transition notifications in process.

A SessionTaskRegistry invokes on_transition once per real transition for every registered observer. Implementations must treat delivery as best-effort: the registry logs errors and never fails the underlying task operation because an observer returned Err. Observers must not block for long — the registry dispatches them off the task-update path, but a slow observer still delays its own delivery.

The server webhook dispatcher (DirectTaskWebhookNotifier) is one implementation. Embedders of everruns-runtime implement this trait to get in-process callbacks with the same transition semantics, without HTTP.

Required Methods§

Source

fn on_transition<'life0, 'life1, 'async_trait>( &'life0 self, task: &'life1 SessionTask, transition: TaskTransition, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Handle one task transition. Best-effort: returning Err is logged and never fails the task operation that produced the transition.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl TaskTransitionObserver for SessionWakeQueue

The queue is a TaskTransitionObserver so it can be attached to the same seam the server webhook dispatcher uses (EVE-729). Terminal and awaiting-input transitions render at full fidelity from the snapshot; a message transition renders from the snapshot’s progress/detail.