lua-users home
lua-l archive

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



On 28-Feb-07, at 10:02 PM, gary ng wrote:


--- Rici Lake <lua@ricilake.net> wrote:
That assumes that you have a supervisor (event loop,
I guess) which handles the coroutines. You could
write this  in Lua,as well; I've put an example on
the wiki at
http://lua-users.org/wiki/CoroutinesAsEventHandlers
I am struggling with this supervisor issue. For many
cases, there is no need for copas(or at least the
semantics don't fit). Yet sending/receiving through
either a pipe or socket is a basic need for many
applications.

This would create a problem of, what supervisor to
use(or how to coop the supervisors). Take this
supervisor as an example, how can I make it work with
copas(as copas handles io/socket related
block/resume/yield which I don't want to re-invent).

Well, that supervisor (which hasn't been very heavily
tested yet :) ) is written to work as a coroutine
itself. So you should be able to use it as a delegate
driven by some other supervisor; at least, that was
the idea.