winit icon indicating copy to clipboard operation
winit copied to clipboard

How to use with tokio or mio?

Open danaugrs opened this issue 1 year ago • 2 comments

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

danaugrs avatar Jul 23 '22 16:07 danaugrs

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.

notgull avatar Aug 11 '22 03:08 notgull

Related: https://github.com/rust-windowing/winit/issues/1199#issuecomment-1221298663

LukasBombach avatar Aug 20 '22 11:08 LukasBombach