After decades of long and loyal service, the famous Python library Eventlet is on the way to being officially retired. Eventlet suffered from several years of scarce maintenance and is now a broken and outdated technology. Eventlet users are encouraged to migrate off of Eventlet.
A bit of history
For almost 20 years, the Eventlet library was a mainstream library of the Python ecosystem. Eventlet has been downloaded almost 80 millions of times. It became famous for its asynchronous features. Eventlet allowed the usage of non-blocking network I/O at a time where async features were absent from CPython. This library is also famous for its usage of the Python monkey patching which allowed to its users to transform existing synchronous code into asynchronous code without to having to rewrite everything.
The lack of active maintenance of Eventlet increased the gap between this library and the recent versions of Python. Eventlet reached a point where this gap is not recoverable.
In a final effort, a couple of volunteers (I'm one of them) decided to transplant a new heart to Eventlet. This new heart is based on Asyncio. Our goal was to allow the Python community to migrate their Eventlet usages to Asyncio. Before that, both technologies were not compatible. Our goal was to open an escape door for all the people depending on Eventlet.
Asyncio was selected as an official and by default alternative to Eventlet for two reasons: Asyncio is a modern implementation of non-blocking behaviors for CPython, and Asyncio is included in the CPython stdlib.
Eventlet is now deprecated and migrations are heavily encouraged. Every Eventlet user should follow the migration guide. Only security fixes and bug fixes patches will be accepted during the coming year. Chances are high that Eventlet will be fully retired by the end of 2025.
How can I start my migration?
Often, projects based on Eventlet were created several years ago. Code bases may have grown big, and for this reason we wanted to allow incremental migrations. So we created a new Eventlet hub named asyncio that you can activate to start the migration.
To do so, set export EVENTLET_HUB=asyncio
or specify the asyncio hub at startup by calling:
import eventlet.hubs
eventlet.hubs.use_hub("eventlet.hubs.asyncio")
From there, you can start to migrate your code to Asyncio by following the migration process. Take a look at our migration guide for more details.
Migrating complex projects with Awaitlet
Asyncio might be an invasive technology. When Asyncio is used, all the code base needs to become adapted to the async paradigm, which could be an issue for large code bases. For these projects, migrating to Asyncio would mean almost a complete rewrite of the code base. For this reason, we created the Awaitlet project. Awaitlet allows you to mix synchronous and asynchronous code without to have to rewrite all your code base.
Awaitlet is born into SQLAlchemy. Originally Awaitlet was a pattern that allowed to modernize SQLAlchemy. This pattern allowed SQLAlchemy to became compatible with Asyncio and was extracted as an independent deliverable (Awaitlet) by my teammate Mike Bayer, who is also the creator of SQLAlchemy.
More details about using Awaitlet can be found in the official documentation.
Conclusion
Eventlet is an outdated technology. If your project relies on Eventlet, then do not lose time and start your migration as soon as possible with the help of our migration guide. We heavily encourage adopting Asyncio, but sometimes people need an intermediate solution; that's why we created Awaitlet.
Don't hesitate to share your experience with us. All feedback is greatly appreciated and each feedback will benefit to the whole community. You can open a new issue to discuss about your use cases.
Thanks for reading.