DistributedExecutor

Trait DistributedExecutor 

Source
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§

Source

fn name(&self) -> &str

Executor name

Source

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

Source

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

Source

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,

Wait for task completion

Provided Methods§

Source

fn is_distributed(&self) -> bool

Check if distributed execution is available

Source

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)

Source

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)

Source

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)

Source

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)

Implementors§