Skip to main content

Scheduler

Trait Scheduler 

Source
pub trait Scheduler: Send + Sync {
    // Required methods
    fn push(&mut self, task_id: TaskId, priority: Priority);
    fn pop(&mut self) -> Option<TaskId>;
    fn is_empty(&self) -> bool;
    fn len(&self) -> usize;
}
Expand description

Trait for custom task schedulers

Required Methods§

Source

fn push(&mut self, task_id: TaskId, priority: Priority)

Add a task to the scheduler

Source

fn pop(&mut self) -> Option<TaskId>

Get the next task to execute

Source

fn is_empty(&self) -> bool

Check if scheduler is empty

Source

fn len(&self) -> usize

Get the number of tasks in the scheduler

Implementors§