Scheduler

Trait Scheduler 

Source
pub trait Scheduler: Send + Sync {
    // Required methods
    fn schedule<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        task: &'life1 Task,
        nodes: &'life2 [Node],
    ) -> Pin<Box<dyn Future<Output = PolarisResult<NodeId>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn name(&self) -> &str;
}
Expand description

Trait for implementing custom schedulers

Required Methods§

Source

fn schedule<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, task: &'life1 Task, nodes: &'life2 [Node], ) -> Pin<Box<dyn Future<Output = PolarisResult<NodeId>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Schedule a task on one of the available nodes

§Arguments
  • task - The task to schedule
  • nodes - Available nodes for scheduling
§Returns

Returns the selected node ID, or an error if scheduling fails

Source

fn name(&self) -> &str

Get scheduler name

Implementors§