Skip to main content

TaskHandler

Trait TaskHandler 

Source
pub trait TaskHandler: Send + Sync {
    // Required method
    fn handle<'life0, 'async_trait>(
        &'life0 self,
        task_id: String,
        message: Message,
        store: Arc<dyn TaskStore>,
    ) -> Pin<Box<dyn Future<Output = Result<(), A2aError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

User-provided handler that processes an incoming message for a task.

Implementations are spawned in a background tokio::spawn and receive an Arc<dyn TaskStore> to update status and add artifacts as they work.

Required Methods§

Source

fn handle<'life0, 'async_trait>( &'life0 self, task_id: String, message: Message, store: Arc<dyn TaskStore>, ) -> Pin<Box<dyn Future<Output = Result<(), A2aError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Implementors§