[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Coroutine trouble
- From: Alexander Gladysh <agladysh@...>
- Date: Sat, 14 Feb 2009 21:52:14 +0300
> local coro -- A forward declaration
> coro = coroutine.create(function()
> coroutine.yield()
> end)
> ENGINE.call_me_later(function() assert(coroutine.resume(coro)) end)
Actually there is no need to yield inside a coro coroutine-function,
this is a copy-paste leftover. It should be read as follows:
local coro -- A forward declaration
coro = coroutine.create(function()
-- do stuff after callback
end)
ENGINE.call_me_later(function() assert(coroutine.resume(coro)) end)
Alexander.