Eventlet is a concurrent networking library for Python that uses coroutines (greenlets) and non-blocking I/O (epoll/libevent) to enable blocking-style programming in a highly scalable, asynchronous environment. As of version 0.41.0, Eventlet is in maintenance mode, discouraging new projects from using it and planning for its eventual retirement in favor of `asyncio` due to compatibility issues with newer Python versions and a growing gap in maintenance.
pip install eventletVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates Eventlet's core functionality: monkey-patching the standard library for non-blocking I/O and spawning greenlets for concurrent execution. It fetches multiple URLs concurrently and then shows cooperative sleeping.
For new projects, consider using Python's built-in `asyncio` library. For existing Eventlet projects, explore migration paths (e.g., using `EVENTLET_HUB=asyncio`) as provided by Eventlet documentation.
Pin your project to a compatible Python version (e.g., Python 3.11 or older) or prioritize migrating away from Eventlet to `asyncio` to leverage newer Python versions.
If migrating, transition code incrementally. When running Eventlet on the `asyncio` hub, use provided APIs to explicitly wrap calls between Eventlet and `asyncio` contexts to ensure proper handling of concurrency primitives. Avoid direct inter-mixing where possible.
Profile memory usage under load. Consider batching tasks, optimizing greenlet creation, and, for long-term solutions, migrating to `asyncio` or `trio` which often offer more refined resource management.
Ensure that `eventlet.monkey_patch()` is called as one of the very first actions in your application's main script, before any other modules that perform blocking I/O are imported. Updating `eventlet` and `dnspython` might also resolve it for some specific version combinations.
To use Eventlet as the asynchronous server for Flask-SocketIO, you must start your application using `socketio.run(app)` instead of `app.run()`.
To resolve this, you generally need to use a Python version older than 3.12. Given Eventlet's maintenance status, the recommended long-term solution is to migrate your project to a more actively maintained asynchronous framework like `asyncio` or `gevent`.
For any new projects, it is strongly recommended to use modern asynchronous libraries such as `asyncio` (built into Python) or `gevent`. For existing projects using Eventlet, plan and execute a migration to one of these actively maintained alternatives.
No dependency data recorded yet.