Open goodboy opened 6 years ago
So there's two ways to integration zmq with asyncio:
pyzmq
implements all the low-level bindings you need to do anything with zmq in Python, and then also provides an implementation of option (1).
aiozmq
uses pyzmq
's low-level bindings, but then implements option (2) on top of them.
In Trio, option (1) is not possible. So we have to do the equivalent of option (2), where we use pyzmq
's low-level bindings and hook them up to Trio's built-in event loop. That's what the notes in the trzmq
repository are about. (This is also why trzmq
is not a totally trivial thing. I don't think it should be too hard, I believe the notes there do describe all the issues, but it took a while to figure that out, which is why I haven't actually finished it :-).)
@njsmith thanks for the input :+1:
I'll be trying to take a look at trzmq
again hopefully soon!
After looking at the trials involved with getting trzmq
working I've instead opted to experimenting with nanomg ng
(aka nng
) for which there is a new python wrapper pynng
being developed with (hopefully) native trio
support in codypiersall/pynng#4.
The details of why nng
was built to replace nanomsg
are interesting and also why nanomsg
was built to improve upon ZeroMQ
.
New work on trzmq
also going on:
https://github.com/remleduff/trzmq/commit/ce72ac5f5e3ae34dc4df349abe6f33e113ee2be2
Simpler then expected.
Gonna wait to see what core trio
devs say about it.
As has always been the plan (because it fits the actor model so well) we need native zeromq support. This will likely need a little thinking and re-design to integrate with the current
Channel
api.Some prerequisites before this can move forward:
trio
support; @njsmith has some notes intrzmq
in order to make this work alongsidepyzmq
.