3 ms·
Can someone compare the concurrency method using async/await vs. generators? What are the pro/cons of each? It seems that with Async/Await, Generators are not
by emilsedgh 9y ago
Can someone compare the concurrency method using async/await vs. generators? What are the pro/cons of each?
It seems that with Async/Await, Generators are not as useful and are more niche. Am I wrong?
- treve 9y agoWhen you use Generators for this style of concurrency, generators are comparable to async/await. The difference is that with async/await support, you still have the option for your promises to resolve generators. Basically by using generators for co-routines, you preclude yourself from some use-cases that generators normally provide. > Generators are not as useful and are more niche. Am I wrong? I would say that generators are more general, and async/await actually more specific to a single use-case.