Hi all! I have a rails app that has the ability to export data to excel. The problem is that the report is very bug, so I need a way to reduce the waiting time of my clients. My thought was, lunch some threads... but... is it safe in rails? Thanks Pedro Cardoso -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
The answer in RoR for long processes is BackgrounDRb http://backgroundrb.rubyforge.org/ Sorry I don''t have more details. I haven''t yet worked with this myself. Maybe someone else can fill in the gaps in my knowledge. What I''m interested in would be that when you send the task to BackgrounDRb process and you request-response cycle ends, how do you then provided feedback to the using that the process is complete? Is it possible to use AJAX to poll the long process for it''s status, or does the BackgroundDRb provide feedback in some form of callback mechanism? I''m guessing the answers to these questions become obvious when working with BackgrounDRb, but I just don''t have those answers for you at this time. On Apr 24, 7:33 am, Pedro Cardoso <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> Hi all! > > I have a rails app that has the ability to export data to excel. The > problem is that the report is very bug, so I need a way to reduce the > waiting time of my clients. > > My thought was, lunch some threads... but... is it safe in rails? > > Thanks > Pedro Cardoso > > -- > Posted viahttp://www.ruby-forum.com/.--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Pedro Cardoso wrote:> Hi all! > > I have a rails app that has the ability to export data to excel. The > problem is that the report is very bug, so I need a way to reduce the > waiting time of my clients. > > My thought was, lunch some threads... but... is it safe in rails? > > Thanks > Pedro CardosoNope. It is unsafe in rails. You should look into backgroundrb instead. It is very simple, you just need to create the proper worker tasks and start the worker tasks using Middleman. You may want to start the worker in background. key = MiddleMan.new_worker(:class => :excel_worker) worker = MiddleMan.worker(key) worker.work_thread(:method => ''export_data'', :args => params) Note that backgroundrb will have to be running first. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
> I have a rails app that has the ability to export data to excel. The > problem is that the report is very bug, so I need a way to reduce the > waiting time of my clients. > > My thought was, lunch some threads... but... is it safe in rails? >Pedro, Backgroundrb (http://backgroundrb.rubyforge.org/) was designed to do exactly this. Check it out. -- Zack Chandler http://depixelate.com --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
> I have a rails app that has the ability to export data to excel. The > problem is that the report is very bug, so I need a way to reduce the > waiting time of my clients. > > My thought was, lunch some threads... but... is it safe in rails?You might look into backgrounddrb... you could pass off the generating of the report to it and then have it update a flag in the database that the report is ready or send an email to the user with the url to download it... -philip --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Thanks! And that would be multi tasking right? Wai Tsang wrote:> Pedro Cardoso wrote: >> Hi all! >> >> I have a rails app that has the ability to export data to excel. The >> problem is that the report is very bug, so I need a way to reduce the >> waiting time of my clients. >> >> My thought was, lunch some threads... but... is it safe in rails? >> >> Thanks >> Pedro Cardoso > > Nope. It is unsafe in rails. You should look into backgroundrb > instead. It is very simple, you just need to create the proper worker > tasks and start the worker tasks using Middleman. You may want to start > the worker in background. > > key = MiddleMan.new_worker(:class => :excel_worker) > worker = MiddleMan.worker(key) > worker.work_thread(:method => ''export_data'', :args => params) > > Note that backgroundrb will have to be running first.-- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On 4/24/07, Pedro Cardoso <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > Thanks! > > And that would be multi tasking right?Well not strictly true, there''s no requirement for BackgroundRb to be running on the same machine as Rails. Which is actually a strong advantage. Though I am not sure if there is some platform sensitivity with Rails + BackgroundRb on windows. I thought it was mentioned in the HOWTO on the rubyonrails site. You might want to check. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---