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

Pull scheduling into separate process #29

Open
savagematt opened this issue Feb 7, 2016 · 0 comments
Open

Pull scheduling into separate process #29

savagematt opened this issue Feb 7, 2016 · 0 comments

Comments

@savagematt
Copy link
Collaborator

savagematt commented Feb 7, 2016

That is:

Our current approach to scheduling jobs relies on agents polling the database at sufficient frequency for the job to be triggered near its due date. This doesn't really scale.

We could move the polling on to the server, but that's also less than ideal.

A better solution:

  • A process on each server keeps track of what the next due job is, initially from a snapshot
  • The server notices a scheduled job being created and updates the next due job
  • The process then sleeps until either the next due date arrives, or is awoken when a bew scheduled job arrives
  • The process generates events into the same stream as newly created jobs with no due date on, which are easier to process because there is a natural stream of updates from the database
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant