Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

For your Taming Async article... #14

Open
trusktr opened this issue Nov 7, 2015 · 2 comments
Open

For your Taming Async article... #14

trusktr opened this issue Nov 7, 2015 · 2 comments

Comments

@trusktr
Copy link

trusktr commented Nov 7, 2015

You might like to consider using async-csp, which uses async/await instead of generators. I think it's much cleaner! I don't think js-csp is compatible with async/await, as it doesn't seem to return promises (or did I miss it?).

@XVincentX
Copy link

It looks like you're right. It returns an IteratorResult which cannot be awaited, of course.

@getify
Copy link

getify commented Apr 10, 2016

async..await-based CSP looks great, but is inherently more limited than generators-based CSP, because you have no control over the scheduling of resumption of the coroutines. The JS engine controls the scheduling of promise resolution, and you have no control from the outside of an async function. That means starvation could occur. I have a generators-based CSP implementation so I've dealt with the scheduling issues first-hand.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants