From c6645c662628e00980136d37f300a0f58ba17f94 Mon Sep 17 00:00:00 2001 From: bunnie Date: Fri, 2 Apr 2021 17:58:03 +0800 Subject: [PATCH] add comment to remind myself on how callbacks should work --- services/rkyv-test-client/src/main.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/services/rkyv-test-client/src/main.rs b/services/rkyv-test-client/src/main.rs index 865783ceb..03a16c2f7 100644 --- a/services/rkyv-test-client/src/main.rs +++ b/services/rkyv-test-client/src/main.rs @@ -13,6 +13,10 @@ fn print_log_messages(log_message: &str, prefix: &str) { fn handle_battstats(bs: com::BattStats) { log::info!("battstats: {:?}", bs); + // note: at this point to repatriate data into the core main loop, you have two options: + // 1. send a new message to the server, using your own private API. This feels "wasteful" + // as you're bouncing a message twice but it keeps the API spaces strictly on crate boundaries + // 2. use an Atomic type to transfer primitive data types from the handler thread to the main thread } #[xous::xous_main]