Discussion around Bradley
Generally good, a bit odd that it is limited to promises, see http://www.2ality.com/2015/03/no-promises.html and https://www.npmjs.com/package/generator-runner
Concerns:
- Sometimes no need to invoke promise task queue (async fn calling async fn etc.)
- lack of abort, generators have
.return(not in v8 yet) that runners can use (compiled output contains.return) - scope nesting if new promises used in a loop/recursively (only applies to compiled output?)
- would need more data / VM implementation
Pros (do not underestimate how valuable these are):
- try/finally work
- loops work
- explicit syntax when code can be stopped
https://github.com/jhusain/asyncgenerator
Concerns:
- Back Pressure
- Abort, like above
- more complex, can be in a state of an await wanting an abort but need error recovery
Pros:
- Can queue data to push to async work
Alex mentioned:
CSP as alternative perspective on Async Generators
- Creates channels
- Limited capacity
http://jlongster.com/Taming-the-Asynchronous-Beast-with-CSP-in-JavaScript