Skip to main content

Executor

Trait Executor 

Source
pub trait Executor: Send + Sync {
    // Required method
    fn execute_node(
        &self,
        node: Arc<dyn Node>,
        state: AgentState,
        config: GraphConfig,
    ) -> Pin<Box<dyn Future<Output = Result<NodeOutput>> + Send>>;
}
Expand description

Trait for executing individual node attempts.

The default InProcessExecutor runs nodes directly in the current tokio runtime. Alternative implementations (e.g., tauri-queue) can be provided behind feature flags.

Uses boxed futures instead of async-trait.

Required Methods§

Source

fn execute_node( &self, node: Arc<dyn Node>, state: AgentState, config: GraphConfig, ) -> Pin<Box<dyn Future<Output = Result<NodeOutput>> + Send>>

Execute a single node attempt.

The executor owns the Arc<dyn Node>, AgentState, and GraphConfig so the returned future is 'static and can be spawned on a task.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§