ui/rq-scheduler — pull request #2 by yosemitebandit (2012-06-23 05:38:37+00:00)
Title: adds cancel method so jobs can be removed from the scheduler queue

I'm using this to allow user-defined schedules to be updated. When an update occurs, the old job in the scheduler queue is canceled and the new one is added in.

In another implementation, I was storing and updating the "most up-to-date job ID" and then, when a job began executing, it would see if its own ID matched the stored one. If not, the job was obsolete and was aborted. This worked for celery via the `request context`, but in rq there is no way to find the id within a job's function (https://github.com/nvie/rq/issues/46).