This crate provides a general purpose scheduler. The horoscope scheduler provides functionality out the box and is easily extensible.
```rust use horoscope::executor::Executor; use horoscope::job::network::{Job, NetType}; use horoscope::scheduler::{Schedule, blocking, daemon, Msg}; use horoscope::store::memory::Store;
fn main() { let store = Store::new(String::from("jobStore-test")); let exec = Executor::new(String::from("executor-test")); let njob = Job::new( String::from("job-1"), String::from("https://ping.me/"), NetType::Get, None, );
let mut blk_scheduler = blocking::Scheduler::new();
blk_scheduler
.add_store(String::from("jobStore-test"), Box::new(store))
.unwrap();
blk_scheduler
.add_executor(String::from("executor-test"), exec)
.unwrap();
let scheduler = daemon(blk_scheduler);
scheduler
.send(Msg::AddJob(
String::from("job-1"),
String::from("jobStore-test"),
String::from("executor-test"),
start_time,
None,
Box::new(njob),
))
.await;
} ```
More examples, including networking and file access, can be found in our
[examples
] directory and in our [documentation].
We believe it's helpful to have general implementations of common use-cases, but will always allow you to take over and implement to your liking.
With cargo add installed run:
sh
$ cargo add horoscope
Licensed under either of Apache License, Version 2.0 or MIT license at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this crate by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.