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
{{ message }}
Repository navigation
Bug: Engine.__init__ creates a separate tokio runtime, conflicting with async environments #92
PyEngine::new() in python/src/engine.rs:116 creates its own Runtime::new() and calls rt.block_on() to build the engine. This creates a separate tokio runtime from the one used by pyo3_async_runtimes for async method calls.
This can cause issues when:
The user is already running an async event loop (e.g. Jupyter, FastAPI)
Multiple Engine instances are created — each spawns its own runtime
The background graph rebuild task runs on a different runtime than the engine's async methods
Relevant Code
python/src/engine.rs:116-143 — PyEngine::new() with Runtime::new().block_on()
Suggested Fix
Use pyo3_async_runtimes::tokio::get_runtime() to share a single tokio runtime, or lazily initialize the engine on first async method call instead of in __init__.
Activity