Run rust code on Main thread #514
Replies: 6 comments
-
Looking at the discussion in #349, I think the idea was to allow using bevy's ECS API convention as a back end implementation, rinf is designed to only use flutter as a front end. To be clear, if you are trying to use flutter's widget catalog in bevy, then rinf is not the solution you seek. The dart runtime is not designed to be a second-class citizen. |
Beta Was this translation helpful? Give feedback.
-
Am planning to use Bevy Gameengine to render 3d tetures in separate window and flutter like a controller GUI for it |
Beta Was this translation helpful? Give feedback.
-
For the goal you outline, I think egui might be more suitable than flutter. If you are absolutely determined to use flutter, then this isn't the proper place to seek help for that goal. Like I said, flutter is not designed to be used as a plugin. |
Beta Was this translation helpful? Give feedback.
-
I understand, i have already tried egui, and theres nothing much fancy we can build in Ui, so i was trying my luck with Flutter, Though i have a rough implementation to make it work, with something like like, |
Beta Was this translation helpful? Give feedback.
-
Might be easier to develop 2 separate companion apps. |
Beta Was this translation helpful? Give feedback.
-
What @2bndy5 said is correct, because Dart runtime must occupy the main thread. Dart's event loop(its entire async system) runs on the main thread as soon as the Flutter app launches, and there's nothing we can do about it. I'm not sure if Bevy can run on a different thread, but if it can't, the only solution might be running it in a separate executable process. |
Beta Was this translation helpful? Give feedback.
-
Like the title says, is it possible to run Rust on Main thread, without blocking the UI, am trying to run Bevy from Flutter
but getting error
Bevy using winit internally to launch a Desktop window, and it requires MainThread
Is there any way or maybe something like running rust as standalone binary and communicate over sockets ?
Beta Was this translation helpful? Give feedback.
All reactions