Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Native MQ transport (aka support for scalability protocols) #19

Open
goodboy opened this issue Jul 17, 2018 · 4 comments
Open

Native MQ transport (aka support for scalability protocols) #19

goodboy opened this issue Jul 17, 2018 · 4 comments
Labels
enhancement New feature or request

Comments

@goodboy
Copy link
Owner

goodboy commented Jul 17, 2018

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:

@goodboy goodboy added the enhancement New feature or request label Jul 17, 2018
@njsmith
Copy link

njsmith commented Jul 17, 2018

So there's two ways to integration zmq with asyncio:

  1. Define a custom asyncio event loop that has special support for zmq, and then use this everywhere.
  2. Use zmq's annoying and error-prone notification API to get it working on top of a normal asyncio event loop.

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 :-).)

@goodboy
Copy link
Owner Author

goodboy commented Jul 17, 2018

@njsmith thanks for the input 👍
I'll be trying to take a look at trzmq again hopefully soon!

@goodboy goodboy changed the title Native ZeroMQ transport Native MQ transport Nov 22, 2018
@goodboy
Copy link
Owner Author

goodboy commented Nov 22, 2018

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.

@goodboy goodboy changed the title Native MQ transport Native MQ transport (aka support for scalability protocols) Feb 4, 2020
@goodboy
Copy link
Owner Author

goodboy commented Mar 2, 2021

New work on trzmq also going on:
remleduff/trzmq@ce72ac5

Simpler then expected.
Gonna wait to see what core trio devs say about it.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants