Preface: I'm trying to prefetch content from a given set of URLs asynchronously.
I'm needing to send my node.js app around 40-60 local ajax requests in order to add jobs to a queue (node-chain-gang) from the client-side.
Right now, I have it making all the requests at once, and either my node.js app can't handle it or it's just not possible to do so many at once, but it ends up crashing or all the requests do not make it through in proper order. I've tried using a setTimeout
in between each request to no avail (in a timely manner).
Is there any other way of queueing these requests/connections asynchronously client-side? Or is there a more efficient way to do this?