5
关于在维基百科的例子: http://en.wikipedia.org/wiki/Coroutine协程VS事件驱动编程
var q := new queue
coroutine produce
loop
while q is not full
create some new items
add the items to q
yield to consume
coroutine consume
loop
while q is not empty
remove some items from q
use the items
yield
我只是想知道传统的基于事件的方法可以处理这种使用模式,为什么需要使用协程?
感谢您的博客推荐! – realjin 2014-08-25 08:50:25