Forum: Ruby on Rails Sceduling Tasks

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
3d5e490b53e8c0d3d5e627cc97a4554a?d=identicon&s=25 Chris Dempsey (Guest)
on 2006-01-08 19:22
(Received via mailing list)
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
8acba6d057b3f0c2c16cca95ad36881b?d=identicon&s=25 Bakki Kudva (bakki)
on 2006-01-08 19:58
(Received via mailing list)
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
6edd67c92a1dab5eb23fed79f3c18564?d=identicon&s=25 David Heinemeier Hansson (Guest)
on 2006-01-08 20:41
(Received via mailing list)
> 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
30269682335f1fb247d71969fa715b5e?d=identicon&s=25 Roberto Saccon (rsaccon)
on 2006-01-08 20:56
(Received via mailing list)
there is also this cronjob plugin
<http://opensvn.csie.org/rails_cron/>which could be helpful
This topic is locked and can not be replied to.