Skip to main content

ExternalChildRunner

Trait ExternalChildRunner 

Source
pub trait ExternalChildRunner: Send + Sync {
    // Required methods
    fn should_handle<'life0, 'life1, 'async_trait>(
        &'life0 self,
        session: &'life1 Session,
    ) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn execute_external_child<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        session: &'life1 mut Session,
        job: &'life2 SpawnJob,
        event_tx: Sender<AgentEvent>,
        cancel_token: CancellationToken,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
}
Expand description

Trait for external child session runtimes (e.g. A2A, CLI adapters).

Implementors are responsible for emitting AgentEvents via event_tx and respecting the cancel_token.

Required Methods§

Source

fn should_handle<'life0, 'life1, 'async_trait>( &'life0 self, session: &'life1 Session, ) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Returns true if this runner should handle the given child session.

Source

fn execute_external_child<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, session: &'life1 mut Session, job: &'life2 SpawnJob, event_tx: Sender<AgentEvent>, cancel_token: CancellationToken, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Execute the child session using an external runtime.

Implementors§