Questions tagged [eventlet]

a concurrent networking library for Python that provides performance and scalability of non-blocking IO while writing simple blocking code (no callbacks) using green threads.

It uses epoll or kqueue or libevent for highly scalable non-blocking I/O. Coroutines ensure that the developer uses a blocking style of programming that is similar to threading, but provide the benefits of non-blocking I/O. The event dispatch is implicit, which means you can easily use Eventlet from the Python interpreter, or as a small part of a larger application. It's easy to get started using Eventlet, and easy to convert existing applications to use it. Start off by looking at examples, common design patterns, and the list of the basic API primitives.

License: MIT.

http://eventlet.net/

311 questions
0
votes
1 answer

Error when importing flask_socket-io : AttributeError: module 'collections' has no attribute 'MutableMapping'

With a python file that is just: from flask_socketio import SocketIO I get the error: > python .\app.py Traceback (most recent call last): File "C:\{...}\server\app.py", line 127, in from flask_socketio import SocketIO File…
Null Salad
  • 765
  • 2
  • 16
  • 31
0
votes
1 answer

Cannot get celery to run task with Flask-SockeIO and eventlet monkey patching

Update 2: The solution is in how monkey patching actually gets done. See my answer below. Update 1: The issue is the monkey patching of eventlet. Monkey patching is pretty magic to me, so I don't fully understand why exactly. I can get the celery…
jacob
  • 828
  • 8
  • 13
0
votes
0 answers

Using RabbitMQ with multiple consumer threads alongside a socketio setup with eventlet

I have a socketio setup that uses an eventlet server. My program gets logs from multiple machines and writes them to a database. I have an event called "new_log" which is triggered whenever a new log is sent through the websocket. Since database…
m.yagmur
  • 41
  • 6
0
votes
0 answers

Python urllib3 module could it be monkeypatched by eventlet?

I use Python eventlet pool and requests module to speed up my HTTPS request. But it makes the requests process slower, I try to find the answer to the question these days. I find some use cases for Python eventlet. such as Speed of fetching web…
Pzhang
  • 193
  • 2
  • 14
0
votes
1 answer

Python greenthread and requests module only process 10 requests at each time?

I am using Python 2.7.5. and try to use co-routine Greenthreads (Python eventlet) and Python requests module to speed up my REST API request. I know The Python requests module uses poolmanager object (from urllib3 module) to maintain connections, I…
Pzhang
  • 193
  • 2
  • 14
0
votes
1 answer

Is there a way to connect to Eventlet via the WebSocket implementation in Firefox 6?

I can't seem to connect to an Eventlet server using the updated WebSocket implementation in Firefox 6 (MozWebSocket). The older implementation that was disabled by default would work fine as long as it was enabled. Is Eventlet's implementation…
Thomas
  • 168
  • 2
  • 9
0
votes
2 answers

Defer processing in Python

I'm trying to write events in a non-blocking fashion so as not to slow down any of our existing processes. It seems like the two options available are: use Twisted's defer object create a python logging handler Are there other options. Anybody…
Adam Nelson
  • 7,932
  • 11
  • 44
  • 64
0
votes
0 answers

Why isn't gunicorn working with my Flask app?

I have a simple Flask app set up which runs with the command flask run. I'd like to be able to run this app in a Docker container, which I'm trying to do using a gunicorn server. However, when I try to run using gunicorn I'm seeing error messages.…
Alistair
  • 433
  • 7
  • 18
0
votes
1 answer

Flask-SocketIO: Background task is started twice in reloader mode

I'm trying to use background tasks with flask-socketio and run into two problems: when in reloader mode, the background task is started twice when changing the code, flask reloads but the background tasks are not killed My code: from flask import…
hansaplast
  • 11,007
  • 2
  • 61
  • 75
0
votes
1 answer

How to solve ValueError('Invalid async_mode specified') for flask-socketio?

I'm testing a flask-socketio server in bitbucket pipeline. It failed with the following messages: Traceback (most recent call last): File "/root/.local/share/virtualenvs/build-3vGKWv3F/lib/python3.7/site-packages/flask_failsafe.py", line 29, in…
Yan Yang
  • 1,804
  • 2
  • 15
  • 37
0
votes
0 answers

Flask-SocketIO via Reverse Proxy (IIS) - Websocket Upgrade Unsuccessful

The Problem I recently posted a question trying to understand how to implement a Flask-SocketIO setup on an IIS webserver (I could only get it to work on my local development server). I was pointed in the direction of using IIS as a reverse proxy,…
lc-51
  • 99
  • 2
  • 7
0
votes
1 answer

eventlet throws error on import in docker

I have been having some odd issues with docker today. I described one issue @ pathlib: cannot import name 'Sequence' from 'collections'. I didn't really need one of the packages that was causing the break so I took it out. Note that this issue was…
Lucas Rahn
  • 185
  • 1
  • 4
  • 10
0
votes
1 answer

Sending and receiving events successfully with socket.io, but nothing is happening

I'm trying to get my webapp to send messages and I can't figure out why it isn't working. There are no errors that I can see, it's just that the actions in my event.py function aren't happening. I am running a gunicorn server with eventlet workers…
3Ring
  • 49
  • 3
0
votes
1 answer

getting realtime output of the 'top' linux command in a web browser with flask python

Currently, I am in the process of building an application that is capable of executing shell commands and fetching the results to a web browser. My problem is that the results display fine on the browser but not in real-time. The command I'm having…
0
votes
1 answer

Async sleep() not working in "connect" event but working in custom event

I used flask-socketio to implement websocket. I used the eventlet/socketio sleep() function, which supposed to work asynchronously. And this is working in my custom event but when it is under the connect event, it is not working. Here is the…
Mainul
  • 13
  • 5