News for hackers. Stuff that matters.
Re:Code optimizations when using async/await by munchbunny on Tuesday January 04, 2022 @07:53PM (#29803357)
> Remember that the context of this discussion is achieving parallelism by not waiting - instead, you create promises in parallel, pass them on, and attach handlers at some later point, e.g. after collecting them in a Promise.all().

Aren't "await Promise.all(...)" and "Promise.all(...).then(...)" more or less equivalent? (I'm less familiar with how JavaScript handles it under the hood.) In one case the callback executes once the promise completes, in another case execution of code after the await resumes once the promise completes. The article was about only awaiting once you actually need the data, whether you do it with continuation passing or async/await seems like an unimportant detail.

Re:Code optimizations when using async/await by nosianu on Wednesday January 05, 2022 @06:30AM (#29807746)
The discussion is about when you attach handlers, and failure handlers specifically. When someone uses async/await style and try/catch but also adds in handling (passing) actually promises, without await-ing them.