Hi all, In continuing with my port from Java to Rails I wanted to ask what people are using for automated tasks. In our current app we have a standalone server that pulls RSS feeds everyday and converts them to the appropriate content types on our system and then another task fires which goes thru these content types and generates an automated email message notifying users of any matches for the day. Currently we're using Spring and Hibernate with Spring's Quartz timer functionality. I could easily move the firing of the processes themselves to the appropriate cron jobs (which I'll prob do), but I'd still like to use AR and whatever else of Rails is necessary to read/ write from the db. Does anyone have a preferred way of doing this so that I can call a Ruby file and have it use all my existing code and support from Rails? Thanks, - jason
on 2005-11-26 18:47
on 2005-11-26 19:19
On Saturday 26 November 2005 17:44, Jason Lee wrote: > functionality. I could easily move the firing of the processes > themselves to the appropriate cron jobs (which I'll prob do), but I'd > still like to use AR and whatever else of Rails is necessary to read/ > write from the db. Does anyone have a preferred way of doing this so > that I can call a Ruby file and have it use all my existing code and > support from Rails? Why not write a little Ruby daemon which uses ActiveRecord? You can use AR outside of Rails. If you don't like that idea you could put the work into a action which you 'call' by requesting it when you want the tasks to be performed. You just need to make your models available to the daemon script. I have lots of little Ruby daemons which use AR for all sorts of things. > Thanks, > > - jason > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails > HTH,
on 2005-11-26 19:27
on 2005-11-26 19:27
This may answers your question: http://wiki.rubyonrails.org/rails/pages/HowToRunBa...
on 2005-11-26 19:39
Hi, yes, I saw this. However, I'm not really looking to run jobs in the background or to fork functionality during a webapp. I'm actually looking to run jobs on a separate machine (altho, the machine is not really the issue) and to actually include my Rails code into the task I'm doing. So like cron -> MyTask.rb -> use existing AR objects. Thanks tho, I'll keep looking. -jason
on 2005-11-26 20:04
Yes, if you really the page closely, it describes just that (plus some more) (hint: script/runner)
on 2005-11-26 20:56
Ok, I'll re-read it again, but more carefully this time. ;) thx.