Replies: 2 comments 1 reply
-
I suggest you stop using eventlet if it gives you compatibility issues. Not monkey patching may be okay in some cases, but not in others, there isn't an absolute answer. |
Beta Was this translation helpful? Give feedback.
-
This is where I am getting confused. If I remove eventlet, does the app lose support of websockets completely? I am running the app on both Linux and Windows (depending the environment). On Linux it's run through Gunicorn I was under the impression that eventlent (or gevent), are mandatory to run flask socketio. Did I not understand correctly? What are the impact if I run flask socketio without eventlet (or gevent)? Thanks again for your time! PS: how about running it with message queue. If not using eventlet, we don't need to monkey patch, is the message queue still going to work? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
We recently moved to use multiple Gunicorn processes and added a message queue (redis), and monkey patching eventlet as per the documentation, it is working well, except that now we're facing issue with some function that we run using socketio.start_background_task that seems to hang forever (and blocking all other processing) since we monkey patched.
The function in question is connecting to Azure Event Hubs to receive notification very similar to this Consume events from an Event Hub
We found out that if we monkey patching using
eventlet.monkey_patch(thread=False)
then the function operates back to normal and the flask app is running normally.Any idea why monkey patching would cause our function to hang, and what are the impact of running monkey patching with thread=False.
Thanks
Note: monkey patching is done at the very beginning before all other imports, and the server is run with socketio.run()
Beta Was this translation helpful? Give feedback.
All reactions