bkeepers/qu — pull request #60 by dwbutler (2013-01-31 19:33:42+00:00)
Title: Graceful shutdown

This pull request implements graceful shutdown for Qu workers. I needed to make the change because when a worker aborts, it sometimes wouldn't be able to re-queue the job into the failure queue due to the Mongoid connection already being closed. So jobs would mysteriously go missing.

Features:
* Optional via configuration: ```Qu.graceful_shutdown = true```
* If the worker is performing a job, waits for the job to complete before shutting down.
* If the worker is blocked waiting for new jobs, Abort is raised instead to force an exit.
* Specs!