E
Eric S Johansson
I'm trying to figure out the right way to serialize a series of
XMLHttpRequest transactions. I'm starting out with a table and I
extract a set of elements from that table. Each set of elements is
packaged into a post request and delivered via XMLHttpRequest. I don't
want to run any request in parallel because each request may create up
to three or four seconds of high load on the server.
the problem I'm having is figuring out how to iterate over the list
given that the requests are handled asynchronously. What trigger do I
use to fire off the next request? The last technique I tried fires off
another send inside the onreadystatechange handler. Unfortunately, that
only sends off one message per submit button press.
so, what's the trick? Do I go to synchronous mode? do I need to create
a new XMLHttpRequest object every time and recursively walk the list of
requests? use a semaphore to detect the onreadystatechange handler
firing and then trigger off the next send requests?
looking forward to your advice,
---eric
XMLHttpRequest transactions. I'm starting out with a table and I
extract a set of elements from that table. Each set of elements is
packaged into a post request and delivered via XMLHttpRequest. I don't
want to run any request in parallel because each request may create up
to three or four seconds of high load on the server.
the problem I'm having is figuring out how to iterate over the list
given that the requests are handled asynchronously. What trigger do I
use to fire off the next request? The last technique I tried fires off
another send inside the onreadystatechange handler. Unfortunately, that
only sends off one message per submit button press.
so, what's the trick? Do I go to synchronous mode? do I need to create
a new XMLHttpRequest object every time and recursively walk the list of
requests? use a semaphore to detect the onreadystatechange handler
firing and then trigger off the next send requests?
looking forward to your advice,
---eric