winit
winit copied to clipboard
How to use with tokio or mio?
What's the best way to use winit with tokio or mio?
Related threads: https://github.com/rust-windowing/winit/issues/1199 https://github.com/tokio-rs/mio/issues/1082
If I were doing it, I would run the event loop, but also spawn a thread that runs a tokio
runtime that receives events from the main loop via an mpsc
channel. You could select!
between operating on input from the mpsc
channel and whatever other event source you have.
Related: https://github.com/rust-windowing/winit/issues/1199#issuecomment-1221298663