在循环中发出的异步请求是否保证按照循环执行的顺序排队?

Are async requests made in a loop guaranteed to be queued in the order of the loop execution?

如果我在 for 循环中执行多个异步 http 请求,那么这些套接字添加到事件循环的顺序 deterministic/guaranteed 是否与循环执行的顺序相同?

function makeRequest(n) {
  http.get("http://www.google.com/index.html?=" + n, function(res) {
    console.log("Got response: " + res.statusCode);
  }).on('error', function(e) {
    console.log("Got error: " + e.message);
  });
}

for (var i=0; i<10; i++) {
  makeRequest(i);
}

我正在和一位同事交谈,我们试图弄清楚这是否属实。因为节点事件循环、libuv 和 socket/OS 编程对我来说是新的,所以都是猜测。

只是试图开发和理解,并没有真正实用的编程应用程序。

谢谢

我认为这并不能保证,尤其是在保持活动状态和套接字重用的情况下。