node.js - 支持 coroutine 会对 Node 带来什么影响?
ringa_lee
ringa_lee 2017-04-17 11:06:33
0
2
496

http://wingolog.org/archives/2013/05/08/generators-in-v8

// notice: function* instead of function
function* values() {
  for (var i = 0; i < arguments.length; i++) {
    yield arguments[i];
  }
}

var o = values(1, 2, 3);  // => [object Generator]

加上以后 Node.js 就不是原来的异步了啊...

ringa_lee
ringa_lee

ringa_lee

reply all(2)
迷茫

Why? This is still asynchronous. It is more convenient to do pipeline. More like fp.

PHPzhong

JavaScript's support for coroutines can be said to be a huge leap forward. It uses new syntax to avoid conflicts with old syntax to achieve new features.

For details, please refer to: Koa, co and coroutine

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template