3 ms·
I think of it the other way around: Thanks to javascript being single-threaded, we now have async/await keywords strewn throughout the software ecosystem where
by doubleunplussed 6y ago
I think of it the other way around: Thanks to javascript being single-threaded, we now have async/await keywords strewn throughout the software ecosystem where they provide no benefit.
- war1025 6y agoAsync is basically a super convenient way to interact with an event loop. Any time you call `await` you are saying "schedule an event on the event loop, and call back into this method with the result once it's available" Multi-threaded code is good for some things, but often you need an event loop to keep things reasonable (GUI code for example). That's where async / await really shines.