From ee3a96c6645326bee6e332ffc859b786e71e05a8 Mon Sep 17 00:00:00 2001 From: Katherine Kiefer Date: Sat, 2 Dec 2023 13:35:50 +1100 Subject: [PATCH] unbound it --- crates/auxcallback/src/lib.rs | 2 +- src/turfs/processing.rs | 12 +++--------- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/crates/auxcallback/src/lib.rs b/crates/auxcallback/src/lib.rs index eccf750b..f044fa5c 100644 --- a/crates/auxcallback/src/lib.rs +++ b/crates/auxcallback/src/lib.rs @@ -23,7 +23,7 @@ pub fn clean_callbacks() { } fn with_callback_receiver(f: impl Fn(&flume::Receiver) -> T) -> T { - f(&CALLBACK_CHANNEL.get_or_init(|| flume::bounded(1_000_000)).1) + f(&CALLBACK_CHANNEL.get_or_init(|| flume::unbounded()).1) } /// This gives you a copy of the callback sender. Send to it with try_send or send, then later it'll be processed diff --git a/src/turfs/processing.rs b/src/turfs/processing.rs index 791362e3..d1086acb 100644 --- a/src/turfs/processing.rs +++ b/src/turfs/processing.rs @@ -396,18 +396,12 @@ fn post_process() { }))); } - let send_failed = sender - .try_send(Box::new(move || { + if should_update_vis { + drop(sender.send(Box::new(move || { let turf = ByondValue::new_ref(0x01, id); update_visuals(turf)?; Ok(()) - })) - .is_err(); - - if should_update_vis && send_failed { - //this update failed, consider vis_cache to be bogus so it can send the - //update again later - tmix.invalidate_vis_cache(); + }))); } }); });