Skip to content

Commit

Permalink
Restore examples
Browse files Browse the repository at this point in the history
  • Loading branch information
Mallets committed Dec 4, 2024
1 parent 30341ff commit bceabb1
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 18 deletions.
2 changes: 1 addition & 1 deletion examples/examples/z_pub_thr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ fn main() {

let publisher = session
.declare_publisher("test/thr")
.congestion_control(CongestionControl::Drop)
.congestion_control(CongestionControl::Block)
.priority(prio)
.express(args.express)
.wait()
Expand Down
28 changes: 11 additions & 17 deletions examples/examples/z_sub.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
use std::time::Duration;

//
// Copyright (c) 2023 ZettaScale Technology
//
Expand Down Expand Up @@ -38,21 +36,17 @@ async fn main() {
.try_to_string()
.unwrap_or_else(|e| e.to_string().into());

// print!(
// ">> [Subscriber] Received {} ('{}': '{}')",
// sample.kind(),
// sample.key_expr().as_str(),
// payload
// );
// if let Some(att) = sample.attachment() {
// let att = att.try_to_string().unwrap_or_else(|e| e.to_string().into());
// print!(" ({})", att);
// }
// println!();
print!(".");
use std::io::Write;
std::io::stdout().flush().unwrap();
tokio::time::sleep(Duration::from_millis(100)).await;
print!(
">> [Subscriber] Received {} ('{}': '{}')",
sample.kind(),
sample.key_expr().as_str(),
payload
);
if let Some(att) = sample.attachment() {
let att = att.try_to_string().unwrap_or_else(|e| e.to_string().into());
print!(" ({})", att);
}
println!();
}
}

Expand Down

0 comments on commit bceabb1

Please sign in to comment.