4 ms·
But then how do you gather promises together to run them in parallel? For sophisticated apps this is crucial.
by inlined 5y ago
But then how do you gather promises together to run them in parallel? For sophisticated apps this is crucial.
- redbar0n 5y agoEach promise you create are executed already on creation. But you gather them by using: `await Promise.allSettled([promise1, promise2, promise3])` https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/allSettled https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...
- hashkb 5y agoOr queues, graphs, or other chaining behavior I can't predict you'll need as a tool author.
- Osiris 5y agoI would assume they would create an array with a bunch of Futures that would resolve at the end of the assignment, or the std lib would offer some ability to explicitly make things run in parallel.