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
5
votes
1 answer

eventlet on OS X?

I'm not sure if Eventlet works on OS X because epolls doesn't support OS X. Traceback (most recent call last): File "/usr/local/Cellar/python/3.7.3/Frameworks/Python.framework/Versions/3.7/lib/python3.7/threading.py", line 917, in…
User
  • 23,729
  • 38
  • 124
  • 207
5
votes
2 answers

Integrate Flask with Faust

I'm trying to get a faust agent to cast a message inside a flask view/endpoint, I can't find any example of it and i'm really struggling. Has anyone tried this successfully? the docs say to use gevent or eventlet as a bridge to asyncio but can't…
shipperizer
  • 1,641
  • 1
  • 13
  • 19
4
votes
2 answers

Is it safe to mix green threads and native threads in a single python process?

Firstly, is it safe to mix green threads such as eventlet or gevent with python native threads from the standard library, i.e. Lib/threading.py in the same python process? Secondly, if it is safe, is it a bad idea?
David Watson
  • 3,394
  • 2
  • 36
  • 51
4
votes
1 answer

Running flask-socketio in thread

I have an interactive Python application where I also want to use flask-socketio to interface with Javascript clients. Hence, I need Python socketio to run as a thread. Approach #1: def socketio_server_fn(): socketio.run(flask_app,…
Anders Petersson
  • 391
  • 1
  • 12
4
votes
0 answers

Flask_Socketio & Eventlet Error: Client is gone, closing socket

I'm trying to setup my first flask_socketio application and have run into a problem where the client will randomly disconnect from the server. I have a custom function in the app named "propertytaxes" this function is performing as expected…
Gugmi
  • 315
  • 1
  • 3
  • 9
4
votes
1 answer

How to asynchronously send data with socketio to a web client?

The following situation: Web client: Using JavaScript socketio to listen for incoming messages (= JavaScript). Web server: Using flask-socketio with eventlet to send data (= Python). Everything works if the client sends a message to the server.…
Regis May
  • 3,070
  • 2
  • 30
  • 51
4
votes
2 answers

How to setup flask-socketio in a docker container?

Hello I'm trying to setup flask-socketio in a docker container. It seems to run but I get an error( from the browser) when I try to access localhost on port 5000 like I'm used to do with flask apps. It say's: unable to connect! I will show you the…
The Fool
  • 16,715
  • 5
  • 52
  • 86
4
votes
2 answers

raise RuntimeError('You need to use the eventlet server. '

In my project, I created a app: the website_chat/views.py code: async_mode = 'eventlet' import os from django.http import HttpResponse import socketio basedir = os.path.dirname(os.path.realpath(__file__)) sio =…
aircraft
  • 25,146
  • 28
  • 91
  • 166
4
votes
1 answer

Celery Workers' Utilization Decreases With More Workers

I'm trying to make thousands of GET requests in the smallest amount of time possible. I need to do so in a scalable way: doubling the number of servers I use to make the requests should halve the time to complete for a fixed number of URLs. I'm…
4
votes
1 answer

Can not remote debug if there is eventlet.monkey_patch() in code?

I am trying to do remote debug with PyCharm+Pydevd on python code. The code I try to remote debug is below: #!/usr/bin/python import eventlet eventlet.monkey_patch() def main(): import pydevd pydevd.settrace('10.84.101.215', port=11111,…
Kramer Li
  • 2,284
  • 5
  • 27
  • 55
4
votes
3 answers

ImportError: No module named eventlet

I have installed eventlet library in python using : pip install eventlet. But when I tried to import eventlet this error occured: $python Python 2.7.10 (default, Oct 23 2015, 18:05:06) [GCC 4.2.1 Compatible Apple LLVM 7.0.0 (clang-700.0.59.5)]…
the_unknown_spirit
  • 2,518
  • 7
  • 34
  • 56
4
votes
1 answer

Celery + Eventlet pool does not improve execution speed of asynchronous web requests

As mentioned in the celery docs, the eventlet pool should be faster than the prefork pool for evented I/O such as asynchronous HTTP requests. They even mention that "In an informal test with a feed hub system the Eventlet pool could fetch and…
Tristan
  • 413
  • 1
  • 6
  • 10
4
votes
1 answer

Python too many open files, eventlet and multiprocessing.dummy

I have a Python 2.7 script running on Linux that crashes with IOError: [Errno 24] Too many open files. When I run lsof -p to see what files the script has open, I see an increasing number of anon_inode files. This script first…
Hélène Martin
  • 1,409
  • 2
  • 15
  • 42
4
votes
1 answer

How to implement timeout in python truly?

How to truly implement timeout in python? http://eventlet.net/doc/modules/timeout.html Code looks like: #!/usr/bin/python import eventlet import time import sys import random while True: try: with eventlet.timeout.Timeout(1,…
4
votes
6 answers

What are the advantages of multithreaded programming in Python?

When I hear about multithreaded programming, I think about the opportunity to accelerate my program, but it is not? import eventlet from eventlet.green import socket from iptools import IpRangeList class Scanner(object): def __init__(self,…
Denis
  • 7,127
  • 8
  • 37
  • 58
1 2
3
20 21