[zeromq-dev] Thread safe Pub/Sub and Multicast

Doron Somech somdoron at gmail.com
Sat Mar 12 02:00:58 CET 2016


Hi All,

During the ZeroMQ hackathon I have added the Radio/Dish pattern (thread
safe version of pubsub) and multicast support (only for Radio/Dish sockets)
to both libzmq and czmq.

Radio/Dish is very similar to pub/sub with some differences:

   - Thread safe, you can send and receive messages from multiple threads,
   so for publisher you now don't need internal device to publish from
   multiple threads and with subscriber you can use it as load balancer.
   - Only single frame can be sent
   - Radio/Dish matching is exact matching (vs prefix of pubsub)
   - Group (Radio/Dish topic) is string and currently limited to 15 chars
   (might be increased in the future)
   - Group is set as part of the zmq_msg (libzmq) or zframe (czmq).
   - You call join or leave on the socket (with methods instead of socket
   options)

To learn how to use it with czmq take a loot at the following gist:
https://gist.github.com/somdoron/9423196a228775c8f5af

For libzmq take a loot at the test:
https://github.com/zeromq/libzmq/blob/master/tests/test_radio_dish.cpp#L90

And the most exciting news, with radio-dish you can use multicast
transport, just replace the address from following gist with udp transport
and multicast address, following is a valid address for example:
udp://239.0.0.1:55555

Regards

Doron
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20160312/df9f79ae/attachment.html>


More information about the zeromq-dev mailing list