Skip to content

Commit

Permalink
unbound it
Browse files Browse the repository at this point in the history
  • Loading branch information
jupyterkat committed Dec 2, 2023
1 parent a2f2faf commit ee3a96c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
2 changes: 1 addition & 1 deletion crates/auxcallback/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ pub fn clean_callbacks() {
}

fn with_callback_receiver<T>(f: impl Fn(&flume::Receiver<DeferredFunc>) -> 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
Expand Down
12 changes: 3 additions & 9 deletions src/turfs/processing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
})));
}
});
});
Expand Down

0 comments on commit ee3a96c

Please sign in to comment.