lua-users home
lua-l archive

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


> Note that the first line involves a round trip to the server.  I
> am currently assuming the users will not be using coroutines and I
> am making the above work by lua_yield()ing back to where I called
> the interpreter, waiting for the open message to come back from
> the server, then lua_resume()ing back the message object.  The
> problem with this is if the user uses a coroutine, the yield in
> Msg.OpenByPath() won't yield all the way back out.  Is there some
> other way to break out of Lua execution all the way back to the
> initial call into the interpreter, leaving the state intact so I can
> resume it later once I have the available data?

One solution to your problem is to redefine the coroutine operators so
that "yield" can specify which outer resume it wants to go to. For more
details, have a look at "Revising Coroutines", Section 5.6:

  www.inf.puc-rio.br/~roberto/docs/MCC15-04.pdf

-- Roberto