Skip to content

Support for eventlet #39

@mnaser

Description

@mnaser

I've been struggling with a library which I'm writing using pyo3, where it's consumed by a Python project that uses eventlet. The issue with this model is that eventlet at it's core uses greenthreads, not threads. This means that when I added this project and used get_runtime() to call into it, I'll end up with something like this:

pyo3_runtime.PanicException: Cannot start a runtime from within a runtime. This happens because a function (like block_on) attempted to block the current thread while the thread is being used to drive asynchronous tasks.

Now, I believe that mainly the reason for this is that different greenthreads (under the same OS thread) are trying to call block_on() using the same runtime, and Tokio doesn't like that.

Spinning up a thread seems to be very much the "big bang" button, but I'm wondering if there's any plans or thoughts on how support for eventlet can be added.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions