From 7b860bd7b96fd09dcdc30cb1173dce76572c8aeb Mon Sep 17 00:00:00 2001 From: brayo Date: Wed, 3 Jul 2024 10:29:20 +0300 Subject: [PATCH] docs: additional comments on client.rs --- src/examples/client.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/examples/client.rs b/src/examples/client.rs index 7daa98d..ab34e66 100644 --- a/src/examples/client.rs +++ b/src/examples/client.rs @@ -33,6 +33,7 @@ async fn main() { let bucket_id = format!("test-client-bucket_{}", aw_client.hostname); let event_type = "dummy_data".to_string(); + // Note that in a real application, you would want to handle these errors create_bucket(&aw_client, bucket_id.clone(), event_type) .await .unwrap(); @@ -60,6 +61,7 @@ async fn main() { .unwrap(); // Sleep a second until next heartbeat (eventually drifts due to time spent in the loop) + // You could use wait on tokio intervals to avoid drift tokio::time::sleep(tokio::time::Duration::from_secs_f64(sleeptime)).await; }