lua中携程的调用
function foo(a)print(“foo”, a)return coroutine.yield(2 * a)//第一次调用后会停止在这里,直到第二次调用才继续endco = coroutine.create(function ( a, b )–print(“co-body”, a, b)Geo.pushMsg(a);Geo.pushMsg(b);local r = foo(a + 1)Geo.pushMsg( r)local r, s = coroutine.yield(a +
原创
2021-08-31 16:30:52 ·
684 阅读 ·
0 评论