mirror of
https://github.com/ether/etherpad-lite.git
synced 2026-07-23 01:57:06 +00:00
If you use `await` inside a loop it makes the loop inherently serial. If you omit the `await` however, the tasks will all start but the loop will finish while the tasks are still being scheduled. So, to make a set of tasks run in parallel but then have the code block after the loop once all the tasks have been completed you have to get an array of Promises (one for each iteration) and then use `Promise.all()` to wait for those promises to be resolved. Using `Array#map` is a convenient way to go from an array of inputs to the require array of Promises. |
||
|---|---|---|
| .. | ||
| APIHandler.js | ||
| ExportHandler.js | ||
| ImportHandler.js | ||
| PadMessageHandler.js | ||
| SocketIORouter.js | ||