Skip to main content

TaskHandler

Trait TaskHandler 

Source
pub trait TaskHandler:
    Send
    + Sync
    + Debug {
    // Required method
    fn handle_task<'life0, 'async_trait>(
        &'life0 self,
        task: Task,
        message: Option<A2AMessage>,
    ) -> Pin<Box<dyn Future<Output = Result<Task>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Handler invoked by the server for message/send requests.

Implementations receive a freshly-built task (already in TaskStateSubmitted) plus the incoming user message, run the business logic, and return the final task - typically with state == Completed and an agent reply attached to status.message.

Required Methods§

Source

fn handle_task<'life0, 'async_trait>( &'life0 self, task: Task, message: Option<A2AMessage>, ) -> Pin<Box<dyn Future<Output = Result<Task>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Implementors§