3 ms·
Async/await can be used to implement coroutines, but IIRC only if you wrap all of the code that might be called in async/await as well, and this catch makes the
by stevedekorte 9y ago
Async/await can be used to implement coroutines, but IIRC only if you wrap all of the code that might be called in async/await as well, and this catch makes them practically useless. Why not just provide proper coroutines?
- hdhzy 9y agoBecause people don't need coroutines, just a simpler way to write async code than callbacks and manual promises. While we're at it why coroutines? You can implement coroutines, generators, even try/catch and return given continuations [0]. [0]: https://curiosity-driven.org/continuations https://curiosity-driven.org/continuations