I have a problem using multiple ajax updaters on one page. The first
a slow one; it a form_remote_tag and it calls a method that takes
seconds to process. The second one is faster, it’s a periodical
polls and updates a div every second. The problem is that as soon as i
on the ‘slow’ submitbutton, my fast periodical updater stops updating
the request (~5 sec).
My question is, is there a way to make a request non-blocking, so that
ajaxrequests can still be processed?
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.