You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
In my case, I'm able to actually have a small Python shim and I wrapped it with that and I'm trying that out now, that may be my only way out for now without making my Rust code way too complicated until this code base gets out of eventlet.
I've been struggling with a library which I'm writing using
pyo3
, where it's consumed by a Python project that useseventlet
. The issue with this model is thateventlet
at it's core uses greenthreads, not threads. This means that when I added this project and usedget_runtime()
to call into it, I'll end up with something like this: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.The text was updated successfully, but these errors were encountered: