-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(cron api rust): Implement Cron Events Rust (#145)
* deps: add dashmap crate * fix: use dashmap instead of hashmap * chore: update project dictionary * fix: update cron implementation to use dashmap * fix: simpler * refactor: store OnCronEvent in dashmap Refactor hermes::cron::State to implement CRUD methods to manage crontabs * chore(dict): update project dictionary * feat(deps): add once_cell and saffron crates * refactor(cron): refactor state into its own module * feat: CronTagged impls Hash, PartialEq, Eq, PartialOrd, Ord * chore: cleanup types * feat(wip): spawn a cron queue task and store its handle * fix: remove todos, return values * feat(wip): add cron queue channels and message type. * feat(cron): OnCronEvent calculates next timestamp for schedule * build(deps): add tokio and chrono crates * chore: update project dictionary * feat: use saffron::Cron to parse schedules and generate next timestamp * fix: set MIN_DOW to 1 to keep compatibility with saffron * feat: add types for cron queue * feat: implement cron queue storage functionality * fix: update make_delay to use chron and generate CronJobDelay * refactor: state is managed in threaded async queue * fix: update Host implementation to use global static state * fix: implement Ord for CronComponent to be infallible * fix: cron state can start without queue task * fix: implement Ord for CronTagged to be infallible * fix: typo * fix: remote commands to catch errors for logging * feat(wip): add todo comments for logging * build(deps): update chrono crate and types * feat: expose cron queue state via functions docs: improve docstrings * fix: cleanup * build(deps): remove time crate * fix: remove pub(crate) from cron internal state * feat: on cron event handles response from module * feat: add unit tests for cron queue methods * fix(wip): disable cron state tests * feat: add unit tests for cron queue and cron state methods * fix: delayed crontab does not retrigger * feat: add triggering mechanism for on-cron events * fix: cron state unit test * feat: cron state functions are tested from multiple threads * feat: trigger queue when removing crontab * tidy up comments * fix: pop_app_queues_and_send returns when all items are sent * feat: add unit tests for cron queue triggering to the hermes queue * feat: clear waiting_for task if it has passed when triggering * chore: refactor code for legibility, expose only needed functions * feat: add unit tests for triggering the cron queue * fix: triggering the queue removes stale waiting_event * fix: use newtypes instead of type aliases Use HashSet instead of BTreeSet for app_name list * fix: use HashSet instead of BTreeSet for OnCronEvents tidy up docs * fix: update cron queue tests * fix: type conversion hides inner value * fix: typos in doc comments * fix: remove redundant mapping --------- Co-authored-by: Oleksandr Prokhorenko <djminikin@gmail.com>
- Loading branch information
1 parent
7a17c6b
commit 00e6726
Showing
8 changed files
with
1,412 additions
and
123 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.