lua-users home
lua-l archive

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


On Monday 11, Linker wrote:
> Can lua-zmq make ZeroMQ work with Lua-Coroutine?

I am not sure what you are asking here.  You can send/recv message over ZeroMQ 
sockets from coroutines, but lua-zmq will not yield the coroutine when the 
socket blocks.  You could wrap zmq sockets to make the send/recv call yield 
the calling coroutine, then use a scheduler to resume the coroutine when the 
socket is readable/writable (like what Copas [1] does for TCP sockets).

Someone could add support for zmq sockets to Copas, so coroutines could 
block/yield on tcp/zmq sockets.  But this is not something that I have time or 
the need to do.  I can give pointers to anyone that wants to try this.

1. http://keplerproject.github.com/copas/

-- 
Robert G. Jakabosky