Hello group! I have a problem using multiple ajax updaters on one page. The first one is a slow one; it a form_remote_tag and it calls a method that takes about 5 seconds to process. The second one is faster, it''s a periodical updater that polls and updates a div every second. The problem is that as soon as i click on the ''slow'' submitbutton, my fast periodical updater stops updating during the request (~5 sec). My question is, is there a way to make a request non-blocking, so that other ajaxrequests can still be processed? thanks! Martijn --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Martijn wrote:> Hello group! > > I have a problem using multiple ajax updaters on one page. The first > one is > a slow one; it a form_remote_tag and it calls a method that takes > about 5 > seconds to process. The second one is faster, it''s a periodical > updater that > polls and updates a div every second. The problem is that as soon as i > click > on the ''slow'' submitbutton, my fast periodical updater stops updating > during > the request (~5 sec). > > My question is, is there a way to make a request non-blocking, so that > other > ajaxrequests can still be processed? > > thanks! > > MartijnAjax requests are "Asynchronous" as the acronym implies, but there is a catch. The browser will only allow a certain number of connections to a given client at one time. The connection to the server remains open throughout the entire Ajax call because the the HTTP protocol only allows the server to respond, not to establish a connection. (You knew this because you knew you had to poll for new data) I would start by checking to see how many simultaneous connections your browser allows. A second, and perhaps better thought is to make sure your server can handle multiple requests simultaneously. Webrick for example will only deal with one request at a time. During the 5 seconds it is processing tou ''slow submission'' it cannot update the fast one. John Miller -- 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 -~----------~----~----~----~------~----~------~--~---
hey, tnx! especially the notice that webrick only supports one request clears up a lot Martijn On Aug 27, 6:28 pm, John Miller <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> Martijn wrote: > > Hello group! > > > I have a problem using multiple ajax updaters on one page. The first > > one is > > a slow one; it a form_remote_tag and it calls a method that takes > > about 5 > > seconds to process. The second one is faster, it''s a periodical > > updater that > > polls and updates a div every second. The problem is that as soon as i > > click > > on the ''slow'' submitbutton, my fast periodical updater stops updating > > during > > the request (~5 sec). > > > My question is, is there a way to make a request non-blocking, so that > > other > > ajaxrequests can still be processed? > > > thanks! > > > Martijn > > Ajax requests are "Asynchronous" as the acronym implies, but there is a > catch. The browser will only allow a certain number of connections to a > given client at one time. The connection to the server remains open > throughout the entire Ajax call because the the HTTP protocol only > allows the server to respond, not to establish a connection. (You knew > this because you knew you had to poll for new data) I would start by > checking to see how many simultaneous connections your browser allows. > > A second, and perhaps better thought is to make sure your server can > handle multiple requests simultaneously. Webrick for example will only > deal with one request at a time. During the 5 seconds it is processing > tou ''slow submission'' it cannot update the fast one. > > John Miller > -- > 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 -~----------~----~----~----~------~----~------~--~---