Re:Fixing the callback spaghetti in node.js
by koush on Thursday September 29, 2011 @12:27AM
(#3051123)
That's exactly how this was done. I'm going to implement "yield" as well when I have some time. They both just leverage coroutines.
[ Parent
| on HN ]
Re:Fixing the callback spaghetti in node.js
by tilgovi on Thursday September 29, 2011 @12:55AM
(#3051180)
node-fibers is one attempt to put coroutines into node. I like it because it uses libcoro, which is nice and tight and uses ucontext, and because it works as a module without forking the core of node. Once you've 'fiberized' the server modules to start each request in its own fiber and implemented a call-with-current-continuation on Function.prototype, we're pretty much at the same place you've arrived but without new keywords.