Skip to main content
Redhat Developers  Logo
  • AI

    Get started with AI

    • Red Hat AI
      Accelerate the development and deployment of enterprise AI solutions.
    • AI learning hub
      Explore learning materials and tools, organized by task.
    • AI interactive demos
      Click through scenarios with Red Hat AI, including training LLMs and more.
    • AI/ML learning paths
      Expand your OpenShift AI knowledge using these learning resources.
    • AI quickstarts
      Focused AI use cases designed for fast deployment on Red Hat AI platforms.
    • No-cost AI training
      Foundational Red Hat AI training.

    Featured resources

    • OpenShift AI learning
    • Open source AI for developers
    • AI product application development
    • Open source-powered AI/ML for hybrid cloud
    • AI and Node.js cheat sheet

    Red Hat AI Factory with NVIDIA

    • Red Hat AI Factory with NVIDIA is a co-engineered, enterprise-grade AI solution for building, deploying, and managing AI at scale across hybrid cloud environments.
    • Explore the solution
  • Learn

    Self-guided

    • Documentation
      Find answers, get step-by-step guidance, and learn how to use Red Hat products.
    • Learning paths
      Explore curated walkthroughs for common development tasks.
    • Guided learning
      Receive custom learning paths powered by our AI assistant.
    • See all learning

    Hands-on

    • Developer Sandbox
      Spin up Red Hat's products and technologies without setup or configuration.
    • Interactive labs
      Learn by doing in these hands-on, browser-based experiences.
    • Interactive demos
      Click through product features in these guided tours.

    Browse by topic

    • AI/ML
    • Automation
    • Java
    • Kubernetes
    • Linux
    • See all topics

    Training & certifications

    • Courses and exams
    • Certifications
    • Skills assessments
    • Red Hat Academy
    • Learning subscription
    • Explore training
  • Build

    Get started

    • Red Hat build of Podman Desktop
      A downloadable, local development hub to experiment with our products and builds.
    • Developer Sandbox
      Spin up Red Hat's products and technologies without setup or configuration.

    Download products

    • Access product downloads to start building and testing right away.
    • Red Hat Enterprise Linux
    • Red Hat AI
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform
    • See all products

    Featured

    • Red Hat build of OpenJDK
    • Red Hat JBoss Enterprise Application Platform
    • Red Hat OpenShift Dev Spaces
    • Red Hat Developer Toolset

    References

    • E-books
    • Documentation
    • Cheat sheets
    • Architecture center
  • Community

    Get involved

    • Events
    • Live AI events
    • Red Hat Summit
    • Red Hat Accelerators
    • Community discussions

    Follow along

    • Articles & blogs
    • Developer newsletter
    • Videos
    • Github

    Get help

    • Customer service
    • Customer support
    • Regional contacts
    • Find a partner

    Join the Red Hat Developer program

    • Download Red Hat products and project builds, access support documentation, learning content, and more.
    • Explore the benefits

How to migrate your Eventlet projects to Asyncio

Eventlet is dead; long live Asyncio!

October 2, 2024
Herve Beraud
Related topics:
Event-drivenProgramming languages & frameworksPython
Related products:
Red Hat OpenShift

    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.

    Related Posts

    • Why you should use io_uring for network I/O

    • Design event-driven integrations with Kamelets and Camel K

    • Virtualized database I/O performance improvements in RHEL 9.4

    • Event-driven business automation powered by cloud-native Java

    • Find and compare Python libraries with project2vec

    • Scaling virtio-blk disk I/O with IOThread Virtqueue Mapping

    Recent Posts

    • Every layer counts: Defense in depth for AI agents with Red Hat AI

    • Fun in the RUN instruction: Why container builds with distroless images can surprise you

    • Trusted software factory: Building trust in the agentic AI era

    • Build a zero trust AI pipeline with OpenShift and RHEL CVMs

    • Red Hat Hardened Images: Top 5 benefits for software developers

    What’s up next?

    Explore how the migration toolkit for containers (MTC) paves the way for seamless migration of application workloads from ROSA classic to ROSA HCP clusters, right down to the namespace level in this learning path.

    Start the activity
    Red Hat Developers logo LinkedIn YouTube Twitter Facebook

    Platforms

    • Red Hat AI
    • Red Hat Enterprise Linux
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform
    • See all products

    Build

    • Developer Sandbox
    • Developer tools
    • Interactive tutorials
    • API catalog

    Quicklinks

    • Learning resources
    • E-books
    • Cheat sheets
    • Blog
    • Events
    • Newsletter

    Communicate

    • About us
    • Contact sales
    • Find a partner
    • Report a website issue
    • Site status dashboard
    • Report a security problem

    RED HAT DEVELOPER

    Build here. Go anywhere.

    We serve the builders. The problem solvers who create careers with code.

    Join us if you’re a developer, software engineer, web designer, front-end designer, UX designer, computer scientist, architect, tester, product manager, project manager or team lead.

    Sign me up

    Red Hat legal and privacy links

    • About Red Hat
    • Jobs
    • Events
    • Locations
    • Contact Red Hat
    • Red Hat Blog
    • Inclusion at Red Hat
    • Cool Stuff Store
    • Red Hat Summit
    © 2026 Red Hat

    Red Hat legal and privacy links

    • Privacy statement
    • Terms of use
    • All policies and guidelines
    • Digital accessibility

    Chat Support

    Please log in with your Red Hat account to access chat support.