title: watching a directory in ruby
body: <p>We have an application that needs to process incoming files that are dropped into a directory.
  I am looking for the best way to do this. </p>
  
  <p>We have been using a looping Backgroundrb process, but, to be honest Backgroundrb is unreliable and we'd like to move away from it if possible.</p>
  
  <p>Delayed_job doesn't seem to be for ongoing tasks but for one offs.</p>
  
  <p>I've found DirectoryWatcher <a href="http://codeforpeople.rubyforge.org/directory_watcher/" rel="noreferrer">http://codeforpeople.rubyforge.org/directory_watcher/</a> which looks promising, but ideally we want to have some control over this and also be able to monitor if it is up or not.</p>
  
  <p>So the requirements are:</p>
  
  <ul>
  <li>run forever</li>
  <li>process files in order</li>
  <li>be monitorable</li>
  <li>have some sort of way of restarting it and ensuring it is up (God?)</li>
  </ul>
  
  <p>Thanks for any input! This shouldn't be difficult and I am surprised I can't find someone else talking about this on the web as I would have thought that in business applications this was not uncommon.</p>