use super::{handlers::scheduled_tasks::ScheduledTasks, models::Commands}; #[derive(Clone)] pub struct Scheduler { scheduled_tasks: ScheduledTasks, } impl Scheduler { pub fn new(scheduled_tasks: ScheduledTasks) -> Self { Self { scheduled_tasks } } pub async fn handle(&self, command: Commands) -> anyhow::Result<()> { match command { Commands::ScheduleTask { task, properties } => { self.scheduled_tasks.handle(&task, properties).await?; } } Ok(()) } }