8 ms·
JavaScript Will Finally Get Proper Asynchronous Programming
- VeejayRampay 10y agoServer-side JavaScript has benefited from "proper" asynchronous programming for quite a while now. Promises (or the slightly more exotic choice of generators + promises) make a very nice asynchronous programming experience. async/await will surely make that easier but I don't know about "proper", as it would imply that the current solution are mere hacks, which they're not.
- pcr0 10y agoI'm hoping async/await improves performance over current generator implementations [0]. If implemented as Anders suggested (async/await gets translated to callbacks under the hood) they may even reach or outdo the performance of plain callbacks, especially if done natively. [0]: http://bluebirdjs.com/docs/benchmarks.html http://bluebirdjs.com/docs/benchmarks.html
- pcr0 10y agoHow do you cleanly handle mixing streams and promises/await in code?