lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


>      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.