Skip to main content

ExecutionStrategy

Trait ExecutionStrategy 

Source
pub trait ExecutionStrategy: Send + Sync {
    // Required methods
    fn execute<'a>(
        &'a self,
        action: &'a str,
        input: Value,
    ) -> BoxFuture<'a, Result<Value, StrategyError>>;
    fn tick(&self) -> BoxFuture<'_, Result<Option<Value>, StrategyError>>;
    fn snapshot(&self) -> Result<Box<dyn StrategySnapshot>, StrategyError>;

    // Provided method
    fn signal_routes(&self) -> Vec<SignalRoute> { ... }
}
Expand description

Execution strategy trait.

Controls how agent orchestrates actions (immediate vs state-constrained).

Required Methods§

Source

fn execute<'a>( &'a self, action: &'a str, input: Value, ) -> BoxFuture<'a, Result<Value, StrategyError>>

Execute an action with input.

Source

fn tick(&self) -> BoxFuture<'_, Result<Option<Value>, StrategyError>>

Process pending work (for stateful strategies).

Source

fn snapshot(&self) -> Result<Box<dyn StrategySnapshot>, StrategyError>

Capture current strategy state.

Provided Methods§

Source

fn signal_routes(&self) -> Vec<SignalRoute>

Get signal routes contributed by this strategy.

Implementors§