improve telemetry ergonomics

This commit is contained in:
sergeysav committed 2025-12-31 11:15:39 -05:00
1 parent 778c1a0dfd
commit b8475a12ad
10 files changed
+210 -234

No files matched your search

+5 -4
View File
@@ -1,4 +1,4 @@
use api::client::command::Commanding;
use api::client::command::CommandRegistry;
use api::client::Client;
use api::macros::IntoCommandDefinition;
use api::messages::command::CommandHeader;
@@ -20,13 +20,14 @@ async fn main() -> Result<(), Box<dyn Error>> {
});
}
let client = Arc::new(Client::connect("ws://[::1]:8080/backend")?);
let client = Arc::new(Client::connect("ws://localhost:8080/backend")?);
let cmd = CommandRegistry::new(client);
let handle =
Commanding::register_handler(client, "simple_command/a".to_string(), handle_command);
let handle = cmd.register_handler("simple_command/a", handle_command);
cancellation_token.cancelled().await;
// This will automatically drop when we return
drop(handle);
Ok(())