pub trait DistributedExecutor: Send + Sync {
// Required methods
fn name(&self) -> &str;
fn submit_task<'life0, 'async_trait>(
&'life0 self,
task: DistributedTask,
) -> Pin<Box<dyn Future<Output = Result<UUID>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_task_result<'life0, 'async_trait>(
&'life0 self,
task_id: UUID,
) -> Pin<Box<dyn Future<Output = Result<Option<DistributedTaskResult>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn wait_for_task<'life0, 'async_trait>(
&'life0 self,
task_id: UUID,
timeout_ms: u64,
) -> Pin<Box<dyn Future<Output = Result<Option<DistributedTaskResult>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
// Provided methods
fn is_distributed(&self) -> bool { ... }
fn get_nodes<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<NodeInfo>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
fn join_cluster<'life0, 'life1, 'async_trait>(
&'life0 self,
_coordinator: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait { ... }
fn leave_cluster<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
fn cluster_status<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Option<ClusterStatus>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
}Expand description
Distributed executor trait - allows enterprise to add distributed execution
Consumer implementation: Single-node execution only Enterprise implementation: Multi-node coordination, load balancing
Required Methods§
Sourcefn submit_task<'life0, 'async_trait>(
&'life0 self,
task: DistributedTask,
) -> Pin<Box<dyn Future<Output = Result<UUID>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn submit_task<'life0, 'async_trait>(
&'life0 self,
task: DistributedTask,
) -> Pin<Box<dyn Future<Output = Result<UUID>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Submit task for distributed execution Consumer: executes locally, Enterprise: distributes to cluster
Sourcefn get_task_result<'life0, 'async_trait>(
&'life0 self,
task_id: UUID,
) -> Pin<Box<dyn Future<Output = Result<Option<DistributedTaskResult>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_task_result<'life0, 'async_trait>(
&'life0 self,
task_id: UUID,
) -> Pin<Box<dyn Future<Output = Result<Option<DistributedTaskResult>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get task result
Provided Methods§
Sourcefn is_distributed(&self) -> bool
fn is_distributed(&self) -> bool
Check if distributed execution is available
Sourcefn get_nodes<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<NodeInfo>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_nodes<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<NodeInfo>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get cluster nodes (Consumer: returns self only)
Sourcefn join_cluster<'life0, 'life1, 'async_trait>(
&'life0 self,
_coordinator: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn join_cluster<'life0, 'life1, 'async_trait>(
&'life0 self,
_coordinator: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Join a cluster (Enterprise only)
Sourcefn leave_cluster<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn leave_cluster<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Leave cluster (Enterprise only)
Sourcefn cluster_status<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Option<ClusterStatus>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn cluster_status<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Option<ClusterStatus>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get cluster status (Enterprise only)