DEV Community

Discussion on: Javascript Event Loop for dummies 🤡

Collapse
 
srikanth597 profile image
srikanth597

I have question related to Promise.all() along with Web API.
So for example if I pass 100 requests into this Promise.all, then how exactly Web API will process it.
I mean will it create 100 parallel sub web api threads or how is it going to work.

Collapse
 
papidiagne30 profile image
Papa Abdoulaye Diagne

Promise.all() takes promises as input, and just returns another promise if that happens. So your 100 promises will still be treated in the browser, independantly. And when they all resolve, the promise returned by Promise.all() resolves.