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
Right now, rustbox blocks in poll_event and there is no way of waking it up. An external event in another thread does not seem to have any means of triggering a redraw without using peek_event in a busy loop.
I think a cleaner design would be to replace poll_event through a mpsc::channel. The consumer could then select over multiple channels to act on multiple inputs and peek_event could just be idiomatically replaced through https://doc.rust-lang.org/nightly/std/iter/struct.Peekable.html. This would also allow for the very intuitive for loop syntax:
// rustbox.events is a mpsc::Receiver<rustbox::Event>;whilelet(event) = rustbox.events{match event {
....
}}
The text was updated successfully, but these errors were encountered:
Right now, rustbox blocks in
poll_event
and there is no way of waking it up. An external event in another thread does not seem to have any means of triggering a redraw without using peek_event in a busy loop.I think a cleaner design would be to replace
poll_event
through ampsc::channel
. The consumer could then select over multiple channels to act on multiple inputs andpeek_event
could just be idiomatically replaced throughhttps://doc.rust-lang.org/nightly/std/iter/struct.Peekable.html
. This would also allow for the very intuitive for loop syntax:The text was updated successfully, but these errors were encountered: