Non-blocking ajax requests

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

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 M.

hey, tnx!

especially the notice that webrick only supports one request clears up
a lot

Martijn

On Aug 27, 6:28 pm, John M. [email protected]