开发者

Node.js: Sending many AJAX requests to begin backend job queues

Preface: I'm trying to prefetch content from a given set of URLs asynchronously.

I'm needing to send my nod开发者_如何学Ce.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?


Just queuing such a small number of requests should not be a problem for node.js. Either you have come across a bug in node-chain-gang or you have a bug in your code. It would help if you can narrow down the code to a simpler version with the same behavior and post that here.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜