[zeromq-dev] Thread safe Pub/Sub and Multicast
somdoron at gmail.com
Sat Mar 12 02:00:58 CET 2016
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
To learn how to use it with czmq take a loot at the following gist:
For libzmq take a loot at the test:
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:
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the zeromq-dev