I came across the scheduled-executor crate and it seemed that it tries to replicate the Java version. The problem is that the crate's last update was 3 years ago and seemed to be an abandoned project.
What are your recommendations? What is the best way to implement my requirements in Rust?
let mut interval_timer = tokio::time::interval(chrono::Duration::days(1).to_std().unwrap());
loop {
// Wait for the next interval tick
interval_timer.tick().await;
tokio::spawn(async { do_my_task().await; }); // For async task
tokio::task::spawn_blocking(|| do_my_task()); // For blocking task
}
Using async/await with Tokio may very well be the tool you're looking for. Can you talk a bit more about what kind of actions the scheduled tasks perform?