hi I do a lot of inserts (duration about 3 min) and would like to show a progressbar for the user during this inserts. I tried out to do it with threads, but without a success. Also forking a process doesn''t work (Windows XP). Somebody has an idea? thanks in advance masu example: # this is my loading function def load_data Thread.new do load_data_into_another_db ... end end # this is a ajax function, which is called periodically def ajax_update_progress_bar Thread.new do render :text => Time.now.to_s end end -- 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/2/07, masu <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > hi > > I do a lot of inserts (duration about 3 min) and would like to show a > progressbar for the user during this inserts. I tried out to do it with > threads, but without a success. Also forking a process doesn''t work > (Windows XP). Somebody has an idea?http://backgroundrb.rubyforge.org/ -- Rick Olson http://lighthouseapp.com http://weblog.techno-weenie.net http://mephistoblog.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 do a lot of inserts (duration about 3 min) and would like to show a > progressbar for the user during this inserts. I tried out to do it with threads, but without a success. Also forking a process doesn''t work (Windows XP). Somebody has an idea? >I had to do something similar recently. You can exec "start whatever" in windows and it will start a new process with the command line you provide (rake or ruby script/runner for example). The option /B will even hide the window for the new process. Regarding to the communication back to the user, I did it by creating a "semaphore" file at launching time and deleting it at completion. Meanwhile I had a small ajax magic querying every n seconds back to the server and just checking if the semaphore was still alive. I was also showing a timestamp back to the users so they could know everything was peachy on the server side. I know more solid solutions like Drb are available and recommended, but this one doesn''t need any installation/monitoring and it works fine for simple tasks. regards, javier ramirez -- -------- Estamos de estreno... si necesitas llevar el control de tus gastos visita http://www.gastosgem.com !!Es gratis!! --~--~---------~--~----~------------~-------~--~----~ 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 for your replies. I''m going to try it out the exec thing. by masu -- 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 -~----------~----~----~----~------~----~------~--~---