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