Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cache scheduled jobs in memory so they can be executed without polling #205

Merged
merged 1 commit into from
Jan 25, 2021

Conversation

bensheldon
Copy link
Owner

@bensheldon bensheldon commented Jan 22, 2021

Replaces #163.

Uses a Concurrent::ScheduledTask that is able to schedule future jobs in memory; this is how Rails' Async adapter works. ScheduledTasks are stored in a TimerSet per Scheduler object, which has a max_cache value.

When a Scheduler is created, existing jobs are queried to prefill the cache with values. Otherwise, future-scheduled jobs are added to the cache as they are created/notified.

  • Adds MAX_CACHE / --max-cache configuration options; set to 0 to disable.

Relates to #139 and #90.

@bensheldon bensheldon changed the title Cache scheduled jobs in memory so they are immediately executed Cache scheduled jobs in memory so they can be executed without polling Jan 22, 2021
@bensheldon bensheldon force-pushed the cache_future_jobs branch 27 times, most recently from 6c73fb4 to f9813a5 Compare January 25, 2021 00:44
@bensheldon bensheldon merged commit 910be66 into main Jan 25, 2021
@bensheldon bensheldon deleted the cache_future_jobs branch January 25, 2021 17:08
@bensheldon bensheldon added the enhancement New feature or request label Feb 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant