Hello friends, I have to create a new project in rails which has a long running task, so i need a way to indicate percentage of task completed. updates like: 0% Task started 25% task completed 50% task completed 75% task completed 100% complete. How can i send these task updates from controller action to view in rails. i find an example in asp.net here http://encosia.com/2007/10/03/easy-incr … -requests/ how can i do the same thing in ruby on rails. thanks johnny --~--~---------~--~----~------------~-------~--~----~ 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Frederick Cheung
2008-Jun-09 12:30 UTC
Re: Long Running task percentage indicator in rails
On 9 Jun 2008, at 13:23, Johnny wrote:> > Hello friends, > > I have to create a new project in rails which has a long running task, > so i need a way to indicate percentage of task completed. > > updates like: > > 0% Task started > 25% task completed > 50% task completed > 75% task completed > 100% complete. > How can i send these task updates from controller action to view in > rails. > > i find an example in asp.net here > http://encosia.com/2007/10/03/easy-incr … -requests/ >You can''t follow that approach directly as you can''t send back the response bit by bit with rails (and it''s a bad idea to have such long running actions because they will stop the mongrel accepting connections). The usual approach is to offload the processing task to something like backgroundrb. Fred> how can i do the same thing in ruby on rails. > > thanks > johnny > > >--~--~---------~--~----~------------~-------~--~----~ 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
can i use AJAX updating multiple times within the same controller action? which method should i use. for getting long running process with last around 30 seconds. On Jun 9, 1:30 pm, Frederick Cheung <frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On 9 Jun 2008, at 13:23, Johnny wrote: > > > > > > > Hello friends, > > > I have to create a new project in rails which has a long running task, > > so i need a way to indicatepercentageof task completed. > > > updates like: > > > 0% Task started > > 25% task completed > > 50% task completed > > 75% task completed > > 100% complete. > > How can i send these task updates from controller action to view in > > rails. > > > i find an example in asp.net here > >http://encosia.com/2007/10/03/easy-incr… -requests/ > > You can''t follow that approach directly as you can''t send back the > response bit by bit with rails (and it''s a bad idea to have such long > running actions because they will stop the mongrel accepting > connections). The usual approach is to offload the processing task to > something like backgroundrb. > > Fred > > > how can i do the same thing in ruby on rails. > > > thanks > > johnny--~--~---------~--~----~------------~-------~--~----~ 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Frederick Cheung
2008-Jun-09 16:34 UTC
Re: Long Running task percentage indicator in rails
On 9 Jun 2008, at 17:32, Johnny wrote:> > can i use AJAX updating multiple times within the same controller > action?in a nutshell no> > which method should i use. for getting long running process with last > around 30 seconds.use backgroundrb, backgroundjob, with feedback via ajax. Fred> > > > On Jun 9, 1:30 pm, Frederick Cheung <frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > wrote: >> On 9 Jun 2008, at 13:23, Johnny wrote: >> >> >> >> >> >>> Hello friends, >> >>> I have to create a new project in rails which has a long running >>> task, >>> so i need a way to indicatepercentageof task completed. >> >>> updates like: >> >>> 0% Task started >>> 25% task completed >>> 50% task completed >>> 75% task completed >>> 100% complete. >>> How can i send these task updates from controller action to view in >>> rails. >> >>> i find an example in asp.net here >>> http://encosia.com/2007/10/03/easy-incr… -requests/ >> >> You can''t follow that approach directly as you can''t send back the >> response bit by bit with rails (and it''s a bad idea to have such long >> running actions because they will stop the mongrel accepting >> connections). The usual approach is to offload the processing task to >> something like backgroundrb. >> >> Fred >> >>> how can i do the same thing in ruby on rails. >> >>> thanks >>> johnny > >--~--~---------~--~----~------------~-------~--~----~ 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
> I have to create a new project in rails which has a long running task,> so i need a way to indicate percentage of task completed. see: "Rails csv import with progress bar" http://tinyurl.com/6awqjn http://groups.google.com/group/rubyonrails-talk/browse_thread/thread/694da7cc25379cbb/220373ebe5e89f35?lnk=gst&q=progress Alain --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---