DEV Community

Discussion on: Applying the callback -> async/await conversion process to a real-world example

Collapse
 
anduser96 profile image
Andrei Gatej

Thank you for sharing this!

As far as I can understand, the code above will process the requests sequentially, which means that if each request takes 1s to be solved and you have 8 of these requests, the amount of time you’d have to wait is 8s.
Please correct me if I’m wrong!

I just wanted to make sure that I really understand what’s going on. Thanks!

Collapse
 
ccleary00 profile image
Corey Cleary

Yes, exactly. They will be in series (sequentially). In some scenarios you'll want to call them in series, and others you'll want them concurrently, just depends on the situation.

It's funny you bring this up - my next post is covering this exact topic (concurrent vs. in series async calls). I'll be posting it early next week, but the short of it is that, if you want the async functions to execute concurrently, use Promise.all