I have to make N ajax requests. Each $.ajax call returns a Deferred, but also immediately performs the ajax request. What i want to do is get the Deferreds for all N requests, but only have them performed gradually (say through a setInterval loop). Is it possible to do this?
Share
The browser will by itself limit the number of parallel ajax requests made to a single server (e.g. 4 or 8 at the same time).
If the limit it’s not enough, you could make a queue and schedule some queries:
Then run e.g. 2 of the queries, and each time one finishes, take an other from the queue and run it: