-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Old model: - Each worker does its own polling for tasks. - Each task is claimed in a transaction which is held open until the task is processed. New model: - The processor polls in one place, then passes claimed tasks to workers. This reduces db load when there are no tasks to claim. - Each task is claimed in a transaction which is immediately committed. The task is then updated in a separate transaction once processing is complete. Bonus benefit: if the processor crashes, stuck tasks are now recovered much quicker, after the task timeout has passed, instead of waiting on MySQL's wait_timeout, which is usually set to a high value by default, e.g. 28800s (8h).
- Loading branch information
Showing
3 changed files
with
199 additions
and
88 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
Oops, something went wrong.