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! MSN
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 RDoc Documentation
I have not had the occasion to use this myself but hopefully it’ll work
for
your application.
bakki kudva
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 H.
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