title: How to use callbacks with beanstalkc and beanstalkd
body: <p>I want to use call back went I put job in queue, when the job is reserve and when it's delete.
  How can I do this? </p>
  
  <p>This is my code in PHP: </p>
  
  <pre><code>$queue-&gt;put(array('contracts' =&gt; $stateContract.$id_contract));
  </code></pre>
  
  <p>And this is in Python: </p>
  
  <pre><code>beanstalk.watch('contracts')
  stateTube = beanstalk.stats_tube('contracts')
  
  while stateTube.get('current-jobs-ready') != 0:
  
      #--&gt; keep jos if it isn't "reserve"
      job = beanstalk.peek_ready()
      job = beanstalk.reserve()
      message = job.body
  
      stateTube = beanstalk.stats_tube('contracts')
  
      # --&gt; delete job
      job.delete()
  </code></pre>