Ok time for some dumb questions. I am thinking about how to send the Send World to a non-main thread and have bevy_winit run on the main thread. I'm going to use Send World and "main app" interchangeably here.
Do we really need to run arbitrary code from the Send World on the main thread? Why not just have the main bevy app communicate to bevy_winit via events instead of sending arbitrary code? How much communication really needs to happen between those two?
Example 1: a player clicks the "quit game" button to exit the game. Bevy's UI system (stored on the main app) sends an event through a channel to bevy_winit to close the window.
Example 2: a player presses the spacebar on the keyboard to make the game character jump. bevy_winit sends that event through a channel to the main app, which is then handled by the game developer to make the player jump
I'm sure I'm missing something. Why do we need communication more complicated than events like this?
these are the exact same constraints we operate under when building for the web.