pub trait ExecutionStrategy:
Send
+ Sync
+ Debug {
// Required methods
fn name(&self) -> &str;
fn execute_task(
&self,
task: ExecutionTask,
) -> Pin<Box<dyn Future<Output = SklResult<TaskResult>> + Send + '_>>;
fn execute_batch(
&self,
tasks: Vec<ExecutionTask>,
) -> Pin<Box<dyn Future<Output = SklResult<Vec<TaskResult>>> + Send + '_>>;
fn can_handle(&self, requirements: &TaskRequirements) -> bool;
fn config(&self) -> &StrategyConfig;
fn update_config(&mut self, config: StrategyConfig) -> SklResult<()>;
fn health_check(&self) -> Health;
fn get_metrics(&self) -> StrategyMetrics;
}Expand description
Core execution strategy trait that all strategies must implement
Required Methods§
Sourcefn execute_task(
&self,
task: ExecutionTask,
) -> Pin<Box<dyn Future<Output = SklResult<TaskResult>> + Send + '_>>
fn execute_task( &self, task: ExecutionTask, ) -> Pin<Box<dyn Future<Output = SklResult<TaskResult>> + Send + '_>>
Execute a single task
Sourcefn execute_batch(
&self,
tasks: Vec<ExecutionTask>,
) -> Pin<Box<dyn Future<Output = SklResult<Vec<TaskResult>>> + Send + '_>>
fn execute_batch( &self, tasks: Vec<ExecutionTask>, ) -> Pin<Box<dyn Future<Output = SklResult<Vec<TaskResult>>> + Send + '_>>
Execute multiple tasks in batch
Sourcefn can_handle(&self, requirements: &TaskRequirements) -> bool
fn can_handle(&self, requirements: &TaskRequirements) -> bool
Check if strategy can handle the given task requirements
Sourcefn config(&self) -> &StrategyConfig
fn config(&self) -> &StrategyConfig
Get strategy configuration
Sourcefn update_config(&mut self, config: StrategyConfig) -> SklResult<()>
fn update_config(&mut self, config: StrategyConfig) -> SklResult<()>
Update strategy configuration
Sourcefn health_check(&self) -> Health
fn health_check(&self) -> Health
Get strategy health status
Sourcefn get_metrics(&self) -> StrategyMetrics
fn get_metrics(&self) -> StrategyMetrics
Get strategy metrics