Hacker News new | past | comments | ask | show | jobs | submit login

Proposal? JavaScript 1.7 introduced generators circa 2006, which I do believe lets you implement something like this (in addition to a bunch of other cool things).

https://developer.mozilla.org/en/New_in_JavaScript_1.7#Gener...

Unfortunately, V8 doesn't support generators, as far as I can tell.




sorry? generators? well, I like generators, but what's your point?


  yield;
Will block execution until the generator is resumed and return control flow to the caller. I haven't actually tried it, but it should be pretty straightforward to wrap a generator function in such a way that it's driven (resumed) by callbacks from async I/O calls.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: