Skip to content

Commit

Permalink
Benchmark should not panic on server close
Browse files Browse the repository at this point in the history
  • Loading branch information
caspervonb committed May 17, 2023
1 parent 3c71104 commit 3b8d39f
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions async-nats/benches/core_nats.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,12 @@ pub fn subscribe(c: &mut Criterion) {
let msg = &bmsg[0..*size].to_vec();

loop {
nc.publish("bench".to_string(), msg.clone().into())
.await
.unwrap();
let result = nc.publish("bench".to_string(), msg.clone().into())
.await;

if result.is_err() {
break
}
}
}
});
Expand Down

0 comments on commit 3b8d39f

Please sign in to comment.