-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This introduces a mechanism for politely asking Underway to shutdown. To do so, a new function, `graceful_shutdown` is provided. Calling this function will send a notification to a Postgres channel. Workers listen on this channel and when a message is received will stop processing new tasks. If they're already processing a task, then they wait until that task is done or the task timeout has elapsed, whichever is first. In order to cleanly stop the queue, this function should be used. If stopping in-progress tasks is safe for your use case, then this can be ignored and the queue can be stopped without any delay. Closes #5
- Loading branch information
1 parent
47e30c0
commit 4b3bf40
Showing
2 changed files
with
132 additions
and
8 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