-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GunicornWebWorker blocking loop with ZMQEventloop #1223
Comments
Using Please just run |
We have a working backend system using pyzmq that talks to itself just fine. The issue is really only where we are interfacing with creating external api's. I'm not against looking switching everything to aiozmq. We just need to look at the work involved there. If the above code could be mapped easily to aiozmq then in principle it should be relatively easy to switch for us. Hiding the event loop in someways makes the paradigm a little different, so I'm not sure how much we have to think how we have things setup, but I guess there is benefit of hiding the loop and using the asyncio eventloop, with the concept of Transports and Streams. Is it safe to say a Transport is basically a Socket and could be used in the same way? Is the issue that gunicorn is opening sockets that the zmq.asyncio.ZMQEventLoop can't handle? Thanks for the help. We are definitely trying to use all your hard work integrating asyncio. |
ZMQ monitor socket is supported by Returning to |
While not incorrect, the docs may be hiding some issues. They lead me to believe that #1092 should have solved all the problems I was having with
The use case above works without |
re: |
Looks like by zmq monitor we mean different things. If you are talking about regular ZMQ sockets (REQ-REP, PUB-SUB and PUSH-PULL) you should create a See also zeromq/pyzmq#894 |
I see the confusion in the monitor. I was referring to the documentation example where i would like to monitor multiple streams simultaneously: I'm not sure I understand what you mean saying the event loop internally processes their activities. In the above, it seems that a call back function needs to be created for every
Isn't this the functional equivalent of a poller? Does it make sense to provide the conceptual continuity with In essense an object could be created 'aiozmq.Poller' that implements the
where the |
One question. |
For my purpose we just need to receive socket payload.
|
In this case just create a task per ZMQ socket -- it's the most reasonable design. |
I am seeing something similar to MagicStack/uvloop#26 with the ZMQEventloop. Basically just trying to create the ability to asynchronously use zmq to make rpc type calls based on http requests. With web.run_app everything works, but commenting web.run_app and using gunicorn hangs. In the docs it specifically talks about running ZMQ as a background task, so not sure why this doesn't work. Any help is appreciated.
I tried to create the absolute simplest reproducible example of the zmq setup that hangs below.
Is this a case where ZMQ also needs its own specialized worker?
Setup:
pyzmq 15.4.0
aiohttp 1.0.2
python 3.5.2
gunicorn 19.1.0
macosx 10.11.3
The text was updated successfully, but these errors were encountered: