pool: process all events as soon as possible

before we were only processing one event per frame. This ensured that
not too much time is spent processing events in a single frame.
Unfortunately since we don't have persistent frame rendering, this is
not reliable.

We can look into limiting the number of events processed per frame if
message processing gets heavy.
This commit is contained in:
William Casarin
2023-12-24 12:28:25 -08:00
parent 09cd8ff379
commit 17ec0c0a99

View File

@@ -119,7 +119,7 @@ fn try_process_event(damus: &mut Damus, ctx: &egui::Context) {
damus.pool.keepalive_ping();
// pool stuff
if let Some(ev) = damus.pool.try_recv() {
while let Some(ev) = damus.pool.try_recv() {
let relay = ev.relay.to_owned();
match ev.event {