title: How to find and kill a running Resque job on Rails?
body: <p>I am using <a href="https://github.com/defunkt/resque" rel="nofollow">Resque</a> to process some background jobs on a Rails application.</p>
  
  <p>The thing is that clients can cancel this jobs, so:</p>
  
  <ul>
  <li><p>If the job is still on the queue: dequeue it</p>
  
  <pre><code>Resque.dequeue(GitHub::Jobs::UpdateNetworkGraph, 'repo:135325')
  </code></pre></li>
  <li><p>If the job has finished: do nothing</p></li>
  <li><p>If the job is running: ???</p></li>
  </ul>
  
  <p>Is there a way to programmatically find the job and in case it is running tell it to stop immediatly? My main concern is to be sure that I kill the desired job, not the current one being processed as it could be a different one form the moment I ask if it is running until the moment I kill it.</p>