Home

Awesome

Lua binding to ZeroMQ library.

Build Status Coverage Status Licence

Support ZeroMQ version 3.2.x/4.x<br/> This library is not dropin replacement for lua-zmq library.<br/> This library has C and FFI version of binding.

Source Code

https://github.com/zeromq/lzmq

Install

If you plan use lzmq.threads module then you should also install llthreads2<br/>

API

This is short API description.<br/> See also exampes from OMQ - The Guide.<br/>

Performance

To run same test you should copy original performance tests to exampes/perf2/libzmq and run runner.lua from exampes/perf2. For now it require LuaJIT and exists C and FFI version of lzmq library.<br/> Of course you can run any test manually.

Inproc Throughput Test:

message size: 30 [B]<br/> message count: 10000<br/> mean throughput [Mb/s]:<br/>

#libzmqstrstr(ffi)msgmsg(ffi)
1349.396307.141393.636186.162239.617
2350.007310.398412.371188.132248.011
3377.596311.284413.010205.076281.228
4422.535308.206414.007174.406248.679
5392.477311.324411.876181.722274.946
6382.470309.917395.127177.528631.413
7393.636324.851415.010186.437282.686
8386.910303.298379.627116.919268.908
9397.022311.931415.945187.749244.998
10438.196302.763412.229189.813255.646

Inproc Latency Test:

message size: 1 [B]<br/> message count: 10000<br/> average latency [us]:<br/>

#libzmqstrstr(ffi)msgmsg(ffi)
197.35697.37898.22194.27496.880
295.82896.73695.957100.71196.992
399.656100.34795.67297.98195.312
496.64999.94394.54396.19894.674
596.013102.19694.18497.57594.990
696.37197.92598.37795.35097.165
796.25393.62597.19894.85694.544
895.15596.37194.90496.79295.507
994.70396.69896.92497.95195.527
1095.63597.94695.68496.42992.629

Incompatibility list with lua-zmq (this is not full)

Featurelua-zmqlzmq
global zmq variablecreatedoes not create
zmq.initio_threads optionalio_threads require
create messagezmq.zmq_msg_t.init_XXXzmq.msg_init_XXX
message as stringtostring(msg)msg:data()/tostring(msg)
message as udmsg:data()msg:pointer()
msg:close();msg:data()AVlua error