bkeepers / qu

a Ruby library for queuing and processing background jobs.
MIT License
506 stars 50 forks source link

Graceful Quit #41

Closed lyondhill closed 12 years ago

lyondhill commented 12 years ago

Add in one additional trap to handle graceful quitting.

bkeepers commented 12 years ago

Thanks for the pull request. The only challenge with this is that the backends are all blocking, so if there are no jobs in the queue, #work will never return and the worker will never shut down.

It was an intentional design decision to make qu abort immediately instead of finishing the current job. I'm not opposed to making that optional, but we'll have to think through how to make it work properly.

bkeepers commented 12 years ago

Closing for now until we can come up with something that deals with the blocking issue. Any ideas?