Shopify/resque — pull request #1 by csfrancis (2014-06-25 15:58:31+00:00)
Title: Kill jobs from Resque web interface

@Sirupsen, @jstorimer /cc: @Shopify/webscale, @kristianpd

This adds functionality to Resque to kill jobs from the web UI:
![image](https://cloud.githubusercontent.com/assets/4303686/3387723/c0c3ce2c-fc80-11e3-8e0f-296fd97a49fd.png)

This works by setting a key in redis to indicate that the child job process should be killed. Because `Process.waitpid` is blocking, I had to modify the way in which Resque waits on its child process.

I decided to use a pipe and have the parent block in a read `select`, while the child writes to the pipe when it is finished working. There's a 5 second timeout on the `select`, at which point we'll poll redis to see if the child job should be killed.