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
Due to how winit takes over the main thread on all currently supported platforms, helpers like #[tokio::main] aren't compatible with Cushy. This is because any tasks assigned to the executor runtime on the main thread will never be yielded to. Additionally, Cushy spawns extra threads. For example, trying to call tokio::spawn from an animation callback will fail because the animation thread doesn't know about the tokio runtime.
We need a way to allow users to initialize a runtime on each thread Cushy spawns, and we should make it really easy to enable tokio support.
Due to how winit takes over the main thread on all currently supported platforms, helpers like
#[tokio::main]
aren't compatible with Cushy. This is because any tasks assigned to the executor runtime on the main thread will never be yielded to. Additionally, Cushy spawns extra threads. For example, trying to calltokio::spawn
from an animation callback will fail because the animation thread doesn't know about the tokio runtime.We need a way to allow users to initialize a runtime on each thread Cushy spawns, and we should make it really easy to enable tokio support.
How to use Tokio today
I've created a minimal example showing how to integrate Tokio and Cushy here: https://github.com/khonsulabs/cushy-tokio-example
The text was updated successfully, but these errors were encountered: