Open emmanueltouzery opened 3 years ago
Sorry, I thought I had answered this question. It seems like a bug indeed. I don't have much time to debug this currently, but if you're willing, you could start by looking at whether those functions are called during the busy loop.
see reproduction here: https://github.com/emmanueltouzery/relm_process_events
the code adds 100k rows in a gtk treeview. It does so through a busy loop in the gtk GUI thread. BUT it doesn't freeze the GUI thread because it regularly calls:
however that is not enough apparently to enable relm's event processing. It seems relm components' update() methods are called only after such a busy loop. In this repro, I listen to double clicks on grid rows. When there is such a double click, I make a println!()... this works during the busy loop:
[src/main.rs:46] i = 65398 [src/main.rs:46] i = 65399 [src/main.rs:46] i = 65400 emitting relm event [src/main.rs:46] i = 65401 [src/main.rs:46] i = 65402
however the update() itself, that should be called as a result of the stream().emit() being invoked, is not invoked until after the busy loop finishes:
[src/main.rs:46] i = 99997 [src/main.rs:46] i = 99998 [src/main.rs:46] i = 99999 emitting relm event [src/main.rs:69] event = RowClicked emitting relm event [src/main.rs:69] event = RowClicked emitting relm event [src/main.rs:69] event = RowClicked