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 Saturday 26 November 2005 17:44, Jason Lee wrote:> 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?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-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >HTH, -- Dominic Marks
http://wiki.rubyonrails.org/rails/pages/HowToRunBackgroundJobsInRails/versions/1 On 11/26/05, Dominic Marks <dom-oCiW/wK895g3fM+T6T0RSip2UmYkHbXO@public.gmane.org> wrote:> > On Saturday 26 November 2005 17:44, Jason Lee wrote: > > 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? > > 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-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > HTH, > -- > Dominic Marks > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >_______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
This may answers your question: http://wiki.rubyonrails.org/rails/pages/HowToRunBackgroundJobsInRails On 11/26/05, Jason Lee <jasonlee9-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> 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 > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
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 Nov 26, 2005, at 10:27 AM, Cuong Tran wrote:> This may answers your question: > > http://wiki.rubyonrails.org/rails/pages/ > HowToRunBackgroundJobsInRails
Yes, if you really the page closely, it describes just that (plus some more) (hint: script/runner) On 11/26/05, Jason Lee <jasonlee9-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> 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 Nov 26, 2005, at 10:27 AM, Cuong Tran wrote: > > > This may answers your question: > > > > http://wiki.rubyonrails.org/rails/pages/ > > HowToRunBackgroundJobsInRails > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
Ok, I''ll re-read it again, but more carefully this time. ;) thx. On Nov 26, 2005, at 11:01 AM, Cuong Tran wrote:> Yes, if you really the page closely, it describes just that (plus > some more) > (hint: script/runner) > > On 11/26/05, Jason Lee <jasonlee9-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> 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 Nov 26, 2005, at 10:27 AM, Cuong Tran wrote: >> >>> This may answers your question: >>> >>> http://wiki.rubyonrails.org/rails/pages/ >>> HowToRunBackgroundJobsInRails >> >> _______________________________________________ >> Rails mailing list >> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >> http://lists.rubyonrails.org/mailman/listinfo/rails >> > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails