Throttle amount of promises open at a given time
问题 The following Typescript performs each call to doSomething(action) one at a time. (Meaning the second item in the list does not get a call made until the first one is done). async performActionsOneAtATime() { for (let action of listOfActions) { const actionResult = await doSomethingOnServer(action); console.log(`Action Done: ${actionResult}`); } } This one will send all the requests to the server right away (without waiting for any responses): async performActionsInParallel() { for (let