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§
Sourcefn execute<'a>(
&'a self,
action: &'a str,
input: Value,
) -> BoxFuture<'a, Result<Value, StrategyError>>
fn execute<'a>( &'a self, action: &'a str, input: Value, ) -> BoxFuture<'a, Result<Value, StrategyError>>
Execute an action with input.
Sourcefn tick(&self) -> BoxFuture<'_, Result<Option<Value>, StrategyError>>
fn tick(&self) -> BoxFuture<'_, Result<Option<Value>, StrategyError>>
Process pending work (for stateful strategies).
Sourcefn snapshot(&self) -> Result<Box<dyn StrategySnapshot>, StrategyError>
fn snapshot(&self) -> Result<Box<dyn StrategySnapshot>, StrategyError>
Capture current strategy state.
Provided Methods§
Sourcefn signal_routes(&self) -> Vec<SignalRoute>
fn signal_routes(&self) -> Vec<SignalRoute>
Get signal routes contributed by this strategy.