This seems to work:
function callLoop (n) {
function caller () {
console.log("hello from " + n);
setTimeout(function () {
caller();
}, 10000);
}
caller();
}
for (var i = 0; i < 5; i++) {
callLoop(i);
}
setTimeout, in this example, would instead be a long-running network call. Is this the "correct" way to parallelize these network calls?