Hi,
Thanks for pyzmq :)
Is DISH/RADIO support available / coming in pyzmq ?
On Ubuntu Xenial 64 bit, I compiled my own zeromq with --prefix=/usr/local. I then install pyzmq with --zmq=/usr/local but RADIO + DISH didn't seem to be available -
AttributeError: module 'zmq' has no attribute 'DISH'
Cheers
S
These features are unreleased drafts at this point. Did you configure your libzmq with --enable-drafts
set? Draft features are disabled by default in current master of libzmq. Since the draft mechanism is _itself_ also an unreleased spec subject to change, only pyzmq >= 15.4 even tries to support it. pyzmq should detect the draft API if it was enabled (zmq.DRAFT_API), then zmq.DISH
should be defined. The additional draft _methods_ associated with those sockets are not exposed yet, however.
If DISH is not defined, you can create a dish socket with
zmq.RADIO = 14
zmq.DISH = 15
since socket types are just constants, after all.
I've had bad experiences every time I try to support unreleased features from libzmq in pyzmq, so I'm planning to wait until closer to release (perhaps after the first beta) before adding these things.
Cheers this all makes lots of sense, I'll stick to non draft features for now :)
Now libzmq enables the draft API by default. Is it a good time to support the draft API in PyZMQ? Such as zmq.RADIO
, zmq.DISH
, or zmq.Socket.join
.
@minrk Would you reopen this issue please?
Thank you!
Now we need some Pythonic API for zmq_join
, zmq_leave
, or zmq_msg_set_routing_id
.
Yup, you can create RADIO/DISH sockets just fine now, but since zmq_msg_set_group
and zmq_join|leave
are not yet wrapped, they aren't useful.
Frankly, it seems that PUB/SUB do the same thing as RADIO/DISH, only better, since they support multi-frame messages, etc. So I would encourage anyone interested in RADIO/DISH to use PUB/SUB instead, as PUB/SUB is strictly more capable. Same for ROUTER/DEALER vs CLIENT/SERVER, it would seem.
I agree to you. For now, yes, we must use PUB-SUB or ROUTER-DEALER instead of RADIO-DISH or CLIENT-SERVER. There's even no way to make a proxy for the draft patterns.
But as you know, I'm having a multi-threading safety issue when using PUB-SUB in PyZMQ with gevent. So I am interested in the draft patterns especially RADIO-DISH.
The advantage of RADIO/DISH over PUB/SUB in my opinion is more about being able to use UDP.
Yes, PUB-SUB cannot do UDP, which makes the statement regarding PUB-SUB being strictly more capable than RADIO-DISH absolutely false. I need fast video frame transfer and UDP is the primary choice for that, so PUB-SUB is actually nigh useless for my purposes comparatively.
And RADIO-DISH does exact matching on groups, as opposed to prefix matching of PUB-SUB topics. For that reason PUB-SUB is nigh useless for me as well, so I really hope RADIO-DISH becomes stable faster.
I'll work on supporting the draft sockets. You will need to make sure to compile pyzmq and libzmq yourself (avoid public wheels) because pyzmq binaries won't enable unstable draft APIs.
Assuming you have libzmq already built with draft support, you should be able to give this a try with:
pip install --pre pyzmq --install-option=--enable-drafts [-install-option=--zmq=/path/to/zmq/prefix]
and try one of the examples here
Works for me. Thanks!
I'm no longer working on the project where I was going to use this, but thanks for getting it working, I'm sure to in future.
Eventually is available the RADIO/DISH pattern in pyzmq?
Is there any example?
Most helpful comment
The advantage of RADIO/DISH over PUB/SUB in my opinion is more about being able to use UDP.