title: Database Backed Work Queue
body: <p>My situation ...</p>
  
  <p>I have a set of <em>workers</em> that are scheduled to run periodically, each at different intervals, and would like to find a good implementation to manage their execution.</p>
  
  <p>Example: Let's say I have a worker that goes to the store and buys me milk once a week.  I would like to store this job and it's configuration in a mysql table.  But, it seems like a <strong>really</strong> bad idea to poll the table (every second?) and see which jobs are ready to be put into the execution pipeline.</p>
  
  <p>All of my workers are written in javascript, so I'm using node.js for execution and <a href="http://kr.github.com/beanstalkd/" rel="nofollow">beanstalkd</a> as a pipeline.</p>
  
  <p>If new jobs (ie. scheduling a worker to run at a given time) are being created asynchronously and I need to store the job result and configuration persistently, how do I avoid polling a table?</p>
  
  <p>Thanks!</p>