Thread-safe queue in Javascript or jQuery
Posted
by
at
on Stack Overflow
See other posts from Stack Overflow
or by at
Published on 2011-01-17T08:58:26Z
Indexed on
2011/01/17
10:53 UTC
Read the original article
Hit count: 315
I have many asynchronous AJAX calls whose results will get processed. It doesn't matter what order the processing occurs, but the results need to get processed one at a time. So I'd like to simple do my AJAX calls and they all just put their results in a single queue. That queue should then get processed on a single thread. This way the results get processed one at a time as soon as possible.
What's the best way to do this? I'm using jQuery, so happy to take advantage of any facilities it provides for this.
© Stack Overflow or respective owner