Trait scheduled_executor::task_group::TaskGroup [] [src]

pub trait TaskGroup: Send + Sync + Sized + 'static {
    type TaskId: Send;
    fn get_tasks(&self) -> Vec<Self::TaskId>;
    fn execute(&self, _: Self::TaskId);
}

Defines a group of tasks. Task groups allow you to schedule the execution of different tasks uniformly in a specific interval. The task discovery will be performed by get_tasks that will return a list of task ids. The returned task ids will be used by the execute function to run the specified task. get_tasks will be executed one per interval, while execute will be executed every interval / number of tasks. See also: example in the module documentation.

Associated Types

Required Methods

Runs at the beginning of each cycle and generates the list of task ids.

Runs once per task id per cycle.

Implementors