cronic
A cron-enabled task scheduler for async
Rust
toml
[dependencies]
cronic = "0.1"
tokio = { version = "1", features = ["full"] }
```rust
use cronic::Scheduler;
use std::error::Error;
[tokio::main]
async fn main() -> Result<(), Box> {
Scheduler::new()
.setcontext(())
.job("@hourly", &|| {
Box::pin(async {
println!("Every hour!");
})
})
.job("* * * * * *", &|| {
Box::pin(async {
println!("Every second!");
})
})
.job("0 * * * * *", &|| {
Box::pin(async {
println!("Every minute!");
})
})
.start()
.await?;
Ok(())
}
```