Update to BackgrounDRb

Posted by ezmobius Tue, 01 Aug 2006 22:04:00 GMT

So I just pushed out a new release of this plugin that refactors some stuff I wasn’t happy with and adds a few very cool features. Thanks to some nice patches from Michael Siebert on the mailing list we now have support for workers to start up automatically when the drb server is started. And you can also have your workers repeat thier jobs at timed intervals like cron but simpler. Check out the README for more info on the autostart feature. Here is a little example of a worker that runs its task evey ten minutes starting from whenever the worker gets created with MiddleMan.new_worker:

class TimedWorker <BackgrounDRb::Rails  

  repeat_every 10.minutes
  first_run Time.now

  def do_work(args)
    # code in here gets called every 10 minutes 
  end

end

Tags , , , ,  | 3 comments