Well I hope NodeJS ultimately settles on such a syntax to preempt and resume automatically. I love Golang in this regard since it abstracts out everything using channels, and go-routines (not to compare multiple thread support).
It's a nice trick but it's unsafe in general. JavaScript libraries usually assume single-threaded event handling. If you start up another event loop from a callback (while some other library's code is already on the stack), you'll probably break it.
9 comments
[ 3.4 ms ] story [ 26.9 ms ] threadUnless you have Time and RAM to waste.