I wanna make a bunch of (let's say 20) HTTP POST requests (in order to send information of an app to some HTTP servers) simultaneously.
I am using http angular service to return a promise:
function deployPromise(server, app){
return $http({
method: 'POST',
url: server.url,
data: app
});
}
For simultaneous deployments I am using Promise.all that gets the array of deployPromises:
function deploy(servers, app){
Promise.all(servers.map(function(server){
return deployPromise(server, app);
}));
}
Finally I call deploy function with array of available servers and the app info:
deploy(servers, app);
To my surprise, instead of executing all at once, requests are sent (in otherwords, deployPromises are resolved) in a group of 6. I mean, when the first 6 calls are done, then the second 6 calls will be processed and so on.
Do you guys have any idea?