[ANN] lua-zmq & lua-zmq-threads 1.0

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

[ANN] lua-zmq & lua-zmq-threads 1.0

Robert G. Jakabosky
Announcing lua-zmq & lua-zmq-threads release 1.0.

lua-zmq [1] provide complete Lua bindings of the ZeroMQ [2].  ZeroMQ is a
light-weight but very powerful messaging library.  With it you can scale your
application from multiple-threads to a cluster of servers.  ZeroMQ provides
more then just point-to-point messaging, you can do Publish/Subscribe,
Request/Response (with load balancing), or one-way Push/Pull (also with load
balancing).  See the ZeroMQ guide [3] which has a lot of Lua examples.

lua-zmq-threads is a sub-module of lua-zmq that wrap lua-llthreads [4] to
provide Lua with an easy way to start multiple threads that share the same
ZeroMQ context (this allows the threads to use the low-latency "inproc://"
transport for messages).

Rockspecs:
https://github.com/Neopallium/lua-zmq/raw/master/rockspecs/lua-
zmq-1.0-1.rockspec
https://github.com/Neopallium/lua-zmq/raw/master/rockspecs/lua-zmq-
threads-1.0-1.rockspec

1. https://github.com/Neopallium/lua-zmq
2. http://zero.mq/
3. http://zguide.zeromq.org/lua:all
4. https://github.com/Neopallium/lua-llthreads

--
Robert G. Jakabosky

Reply | Threaded
Open this post in threaded view
|

Re: [ANN] lua-zmq & lua-zmq-threads 1.0

Petr Štetiar
Robert G. Jakabosky <[hidden email]> [2011-04-09 19:44:31]:

> Announcing lua-zmq & lua-zmq-threads release 1.0.

Nice work Robert, thanks!

-- ynezz

Reply | Threaded
Open this post in threaded view
|

Re: [ANN] lua-zmq & lua-zmq-threads 1.0

Linker
Can lua-zmq make ZeroMQ work with Lua-Coroutine?

On Mon, Apr 11, 2011 at 15:14, Petr Štetiar <[hidden email]> wrote:
Robert G. Jakabosky <[hidden email]> [2011-04-09 19:44:31]:

> Announcing lua-zmq & lua-zmq-threads release 1.0.

Nice work Robert, thanks!

-- ynezz




--
Regards,
Linker Lin

[hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: [ANN] lua-zmq & lua-zmq-threads 1.0

Robert G. Jakabosky
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

Reply | Threaded
Open this post in threaded view
|

Re: [ANN] lua-zmq & lua-zmq-threads 1.0

Alexander Gladysh
In reply to this post by Robert G. Jakabosky
On Sun, Apr 10, 2011 at 06:44, Robert G. Jakabosky
<[hidden email]> wrote:
> Announcing lua-zmq & lua-zmq-threads release 1.0.

Was anyone able to install lua-zmq on Ubuntu with LuaRocks?

I get an error:

gcc -O2 -fPIC -I/usr/include/lua5.1 -c src/pre_generated-zmq.nobj.c -o
src/pre_generated-zmq.nobj.o -I/usr/include
src/pre_generated-zmq.nobj.c:1856: error: expected declaration
specifiers or ‘...’ before ‘socket_t’
src/pre_generated-zmq.nobj.c: In function ‘poller_find_fd_item’:
src/pre_generated-zmq.nobj.c:1865: error: ‘fd’ undeclared (first use
in this function)
src/pre_generated-zmq.nobj.c:1865: error: (Each undeclared identifier
is reported only once
src/pre_generated-zmq.nobj.c:1865: error: for each function it appears in.)
src/pre_generated-zmq.nobj.c: In function ‘get_zmq_strerror’:
src/pre_generated-zmq.nobj.c:1995: error: ‘ETERM’ undeclared (first
use in this function)
src/pre_generated-zmq.nobj.c: In function ‘ZMQ_Socket__setopt__meth’:
src/pre_generated-zmq.nobj.c:2304: error: ‘ZMQ_RCVMORE’ undeclared
(first use in this function)
src/pre_generated-zmq.nobj.c: In function ‘ZMQ_Socket__getopt__meth’:
src/pre_generated-zmq.nobj.c:2374: error: ‘ZMQ_RCVMORE’ undeclared
(first use in this function)
src/pre_generated-zmq.nobj.c: In function ‘ZMQ_Poller__add__meth’:
src/pre_generated-zmq.nobj.c:2590: error: ‘socket_t’ undeclared (first
use in this function)
src/pre_generated-zmq.nobj.c:2590: error: expected ‘;’ before ‘fd’
src/pre_generated-zmq.nobj.c:2595: error: ‘fd’ undeclared (first use
in this function)
src/pre_generated-zmq.nobj.c: In function ‘ZMQ_Poller__modify__meth’:
src/pre_generated-zmq.nobj.c:2616: error: ‘socket_t’ undeclared (first
use in this function)
src/pre_generated-zmq.nobj.c:2616: error: expected ‘;’ before ‘fd’
src/pre_generated-zmq.nobj.c:2623: error: ‘fd’ undeclared (first use
in this function)
src/pre_generated-zmq.nobj.c:2625: error: too many arguments to
function ‘poller_find_fd_item’
src/pre_generated-zmq.nobj.c: In function ‘ZMQ_Poller__remove__meth’:
src/pre_generated-zmq.nobj.c:2651: error: ‘socket_t’ undeclared (first
use in this function)
src/pre_generated-zmq.nobj.c:2651: error: expected ‘;’ before ‘fd’
src/pre_generated-zmq.nobj.c:2660: error: ‘fd’ undeclared (first use
in this function)
src/pre_generated-zmq.nobj.c:2662: error: too many arguments to
function ‘poller_find_fd_item’
src/pre_generated-zmq.nobj.c: In function ‘zmq__init__func’:
src/pre_generated-zmq.nobj.c:2813: error: too few arguments to
function ‘zmq_init’

More details here:

https://github.com/Neopallium/lua-zmq/issues/2

I guess I'm missing some dependency.

Thanks,
Alexander.

Reply | Threaded
Open this post in threaded view
|

Re: [ANN] lua-zmq & lua-zmq-threads 1.0

Robert G. Jakabosky
On Thursday 21, Alexander Gladysh wrote:
> On Sun, Apr 10, 2011 at 06:44, Robert G. Jakabosky
>
> <[hidden email]> wrote:
> > Announcing lua-zmq & lua-zmq-threads release 1.0.
>
> Was anyone able to install lua-zmq on Ubuntu with LuaRocks?

This problem turned out to be an issue with Ubuntu's old version of ZeroMQ
2.0.6beta.  I can't really make the bindings compatible with that version.  
Also there are a lot of bugs fixed in the 2.0.x series, so it is not really a
good idea to use a version that old.  It is best to upgrade to the 2.1 series
anyways or at least 2.0.11 if you must use the 2.0 series.

For instructions on installing 2.1 on Ubuntu 10.10 see this page:
http://fanf42.blogspot.com/2011/02/installing-zeromq-and-java-bindings-on.html

--
Robert G. Jakabosky

Reply | Threaded
Open this post in threaded view
|

Re: [ANN] lua-zmq & lua-zmq-threads 1.0

Alexander Gladysh
On Fri, Apr 22, 2011 at 03:44, Robert G. Jakabosky
<[hidden email]> wrote:
> On Thursday 21, Alexander Gladysh wrote:
>> On Sun, Apr 10, 2011 at 06:44, Robert G. Jakabosky

>> <[hidden email]> wrote:
>> > Announcing lua-zmq & lua-zmq-threads release 1.0.

>> Was anyone able to install lua-zmq on Ubuntu with LuaRocks?

> This problem turned out to be an issue with Ubuntu's old version of ZeroMQ
> 2.0.6beta.  I can't really make the bindings compatible with that version.
> Also there are a lot of bugs fixed in the 2.0.x series, so it is not really a
> good idea to use a version that old.  It is best to upgrade to the 2.1 series
> anyways or at least 2.0.11 if you must use the 2.0 series.

> For instructions on installing 2.1 on Ubuntu 10.10 see this page:
> http://fanf42.blogspot.com/2011/02/installing-zeromq-and-java-bindings-on.html

Thank you, for the help!

This was indeed the case.

Alexander.