Skip to content

Commit f2bbbee

Browse files
committed
example: Add timeout for helath.check()
Provied a way to test timeout feature. Signed-off-by: Tim Zhang <[email protected]>
1 parent f2c1a91 commit f2bbbee

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

example/async-client.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ async fn main() {
4545
println!(
4646
"Green Thread 1 - {} -> {:?} ended: {:?}",
4747
"health.check()",
48-
thc.check(default_ctx(), &req).await,
48+
thc.check(context::with_timeout(20 * 1000 * 1000), &req)
49+
.await,
4950
now.elapsed(),
5051
);
5152
});

0 commit comments

Comments
 (0)