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
From what i can tell, currently Ports (like crossterm) are only polled once per loop in the EventListenerWorker, basically making PollStrategy::UpTo(10) ineffective and having at most 2 events (one port, one tick) when not using extra ports than default input.
Steps to reproduce
Have a tuirealm 1.9 app (or one of the examples) and try to use PollStrategy::UpTo(10), log the amount of messages you get each .tick call and move the mouse a lot over the terminal (#70), observe only having on average 1 event and at most 2 events per call.
Expected behaviour
Should poll a port until it does not return anything anymore, or make it configurable how much a port is polled.
Environment
OS: Linux Manjaro 23.1.3
Architecture x86_64
Rust version 1.76.0
tui-realm version 1.9.2
Additional information
My guess is this happens because of the following code:
and then sleeping after the loop until the interval_time and only then getting the next event, and so basically making PollStrategy::UpTo(10) not a viable thing, whereas PollStrategy::UpTo(100) might get more events on very slow processors, and so makes it very ineffective and potentially inconsistent.
The text was updated successfully, but these errors were encountered:
Description
From what i can tell, currently Ports (like
crossterm
) are only polled once per loop in theEventListenerWorker
, basically makingPollStrategy::UpTo(10)
ineffective and having at most 2 events (one port, one tick) when not using extra ports than default input.Steps to reproduce
Have a tuirealm 1.9 app (or one of the examples) and try to use
PollStrategy::UpTo(10)
, log the amount of messages you get each.tick
call and move the mouse a lot over the terminal (#70), observe only having on average 1 event and at most 2 events per call.Expected behaviour
Should poll a port until it does not return anything anymore, or make it configurable how much a port is polled.
Environment
Additional information
My guess is this happens because of the following code:
tui-realm/src/listener/worker.rs
Lines 121 to 138 in b33a430
there the
x.poll
always only returns one result, and so overall only polling each port once for one event per event loop:tui-realm/src/listener/worker.rs
Lines 154 to 173 in b33a430
and then sleeping after the loop until the
interval_time
and only then getting the next event, and so basically makingPollStrategy::UpTo(10)
not a viable thing, whereasPollStrategy::UpTo(100)
might get more events on very slow processors, and so makes it very ineffective and potentially inconsistent.The text was updated successfully, but these errors were encountered: