Function new_simple_service_task

Source
pub fn new_simple_service_task(
    name: &str,
    interval: Duration,
    tasks: Vec<(String, SimpleServiceTaskFuture)>,
) -> SimpleServiceTask
Expand description

Creates a new SimpleServiceTask with the specified name, interval, and collection of tasks. This service manages multiple background tasks that run concurrently at fixed intervals.

ยงArguments

  • name - Identifier for this service instance, used in logging
  • interval - Duration between task executions (e.g., Duration::from_secs(60) for minute intervals)
  • tasks - Vector of named tasks to execute periodically, where each task is a tuple of (name, task_function)