Comments (4)
So there's two ways to integration zmq with asyncio:
- Define a custom asyncio event loop that has special support for zmq, and then use this everywhere.
- 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.
@njsmith thanks for the input 👍
I'll be trying to take a look at trzmq
again hopefully soon!
from tractor.
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.
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)
- Macos error while trying to initialize HOT 2
- Need to handle a `KeyError` in `_debug._hijack_stdin_for_child` HOT 2
- Drop `msgpack` dependency, go full `msgspec`
- Handling >= 1 depth (nested) actor trees in the debugger
- `pdbpp` borks our `0.1.0a5` on `pypi` 😂
- Recursion error on `BroadcastReceiver.receive()`?
- `trio.Process` deprecations
- `trio.MultiError` is deprecated -> move to `exceptiongroup.ExceptionGroup` HOT 1
- Share memory (array) sub-system API and optional tight integration with `numpy`
- OS X: shared memory file name length limitation causing error
- `OSError: [Errno 9] Bad file descriptor` in cluster test
- `rust` tasks
- `QUIC` transport research & planning
- `infected_asyncio` task hang (`SIGINT` ignored!) on debug mode breakpointing?
- An actor-runtime equivalent of `trio`'s "guest mode"
- Hot-code-reload: can we do it `git` driven?
- `ray` interop?
- Switching to pdbpp is making it impossible to install with pypy and git HOT 13
- Type annotating `Context.open_stream()` (probably with `msgspec.Struct` subtype(s)) :sunglasses:
- Injecting `Context._scope: trio.Nursery` errors, probably a `ContextCancelled` to start
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tractor.