I have a set of requests but they can not be called all simultaneously so I decided to split the set into the chucks of 10. I am wondering how can I make 10 requests and wait for them all to complete like the example above:
data = []
for(mindex = 0; mindex < 1000; mindex = mindex + 10){
request_chunk = []
for(index = mindex+1; index < mindex+10; index++){
request_chunk.push(api.call(requests[index]).getPromise();
}
data = data + waitPromiseToComplete(request_chunk);
}