Long Running task percentage indicator in rails

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

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

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.

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

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