I''m working on a RoR project and a requirement has popped up that would required certain actions to happen at certain time intervals (as opposed to having a user initiate the action). Is there anything similar to Java''s Quartz library, *nix cron, or anything of the like for Rails? I''m certainly willing to help with/test Ruby code if someone on the list is already working on something. If no one is maybe a few of us can get together to start a little project to add that ability to Rails. Thanks in advance, Chris _________________________________________________________________ On the road to retirement? Check out MSN Life Events for advice on how to get there! http://lifeevents.msn.com/category.aspx?cid=Retirement
Chris, Check out the Observer pattern which is part of the ruby standard library. You could run a time object inside an observable object which you fork off to a sub process, and when it reaches certain markers you could report a change event and notify all observer objects. It is pretty well documented at http://www.ruby-doc.org/stdlib/ I have not had the occasion to use this myself but hopefully it''ll work for your application. bakki kudva On 1/8/06, Chris Dempsey <chris_dempsey@hotmail.com> wrote:> > I''m working on a RoR project and a requirement has popped up that would > required certain actions to happen at certain time intervals (as opposed > to > having a user initiate the action). Is there anything similar to Java''s > Quartz library, *nix cron, or anything of the like for Rails? I''m > certainly > willing to help with/test Ruby code if someone on the list is already > working on something. If no one is maybe a few of us can get together to > start a little project to add that ability to Rails. > > Thanks in advance, > Chris > > _________________________________________________________________ > On the road to retirement? Check out MSN Life Events for advice on how to > get there! http://lifeevents.msn.com/category.aspx?cid=Retirement > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060108/b292f028/attachment.html
> I''m working on a RoR project and a requirement has popped up that would > required certain actions to happen at certain time intervals (as opposed to > having a user initiate the action).We just have a cron script that activates a runner. So set a cron to run "./script/runner ''MaintenanceService.start''" every 2 hours. -- David Heinemeier Hansson http://www.loudthinking.com -- Broadcasting Brain http://www.basecamphq.com -- Online project management http://www.backpackit.com -- Personal information manager http://www.rubyonrails.com -- Web-application framework
there is also this cronjob plugin <http://opensvn.csie.org/rails_cron/>which could be helpful On 1/8/06, David Heinemeier Hansson <david.heinemeier@gmail.com> wrote:> > > I''m working on a RoR project and a requirement has popped up that would > > required certain actions to happen at certain time intervals (as opposed > to > > having a user initiate the action). > > We just have a cron script that activates a runner. So set a cron to > run "./script/runner ''MaintenanceService.start''" every 2 hours. > -- > David Heinemeier Hansson > http://www.loudthinking.com -- Broadcasting Brain > http://www.basecamphq.com -- Online project management > http://www.backpackit.com -- Personal information manager > http://www.rubyonrails.com -- Web-application framework > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-- Roberto Saccon - http://rsaccon.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060108/6b4f8b82/attachment.html