-
Notifications
You must be signed in to change notification settings - Fork 22
Open
Description
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
Labels
No labels