Module scheduled_executor::task_group [] [src]

Task groups can be used whenever there is a sequence of tasks that need to be executed at regular intervals, and the sequence can change across different cycles.

As an example lets suppose we have a list of servers that we want to healthcheck at regular intervals. First, we need to know the list of servers, and the list could change at any time, and once we have the list we need to schedule the health check. Refer to task_group.rs in the example folder to see how such a check could be scheduled.

Traits

TaskGroup

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.

TaskGroupScheduler

Allows the execution of a TaskGroup.