Giter Club home page Giter Club logo

Comments (4)

njsmith avatar njsmith commented on May 24, 2024

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

from tractor.

goodboy avatar goodboy commented on May 24, 2024

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

from tractor.

goodboy avatar goodboy commented on May 24, 2024

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.

from tractor.

goodboy avatar goodboy commented on May 24, 2024

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

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

from tractor.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.