My nodejs code has a loop that calls a Promise-returning function:
collection.forEach((item) => {
promiseReturningFunction(item);
});
The problem is, the backend that is receiving these calls is not that great at handling concurrent requests.
So I want to slow down this loop, each turn waiting for the previous promise to finish. Effectively making it synchronous.
Any ideas?