HI all, I''ve built a few reports that run using .rhtml templates that take more than 30 seconds to run. We''ve been discussing on the list the best way to allow them to run indepdently of the request so the user can continue while report generation is in progress. Using DRB sounds like a good option.. as is just using a database "report queue" table.. But: How do I go about divorcing rails from the web server? I just need to call a particular action on my "Reports" controller.. But attempting to just require config/environment.rb and creating a controller results in ''''uninitialized constant ''ApplicationController''.. It looks like I need to start the application singleton.. is that correct? How do I go about doing so? Thanks in advance.
If I understand you correctly you might be interested in what I found in Rails-commit #939 +* Added script/runner which can be used to run code inside the environment by eval''ing the first parameter. Examples: + + ./script/runner ''ReminderService.deliver'' + ./script/runner ''Mailer.receive(STDIN.read)'' + + This makes it easier to do CRON and postfix scripts without actually making a script just to trigger 1 line of code. You will probably be able to find more documentation in the runner script (I suspect, haven''t looked myself) Sascha
Perfect!! Thanks!! On Tuesday 31 May 2005 11:26, Sascha Ebach wrote:> If I understand you correctly you might be interested in what I found in > Rails-commit #939 > > +* Added script/runner which can be used to run code inside the > environment by eval''ing the first parameter. Examples: > + > + ./script/runner ''ReminderService.deliver'' > + ./script/runner ''Mailer.receive(STDIN.read)'' > + > + This makes it easier to do CRON and postfix scripts without actually > making a script just to trigger 1 line of code. > > > You will probably be able to find more documentation in the runner > script (I suspect, haven''t looked myself) > > Sascha > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails