Skip to content

Commit

Permalink
chore(client): adjust dispatch giver throughput benchmark generics
Browse files Browse the repository at this point in the history
  • Loading branch information
seanmonstar committed Feb 26, 2019
1 parent 1e66033 commit ce2b540
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/client/dispatch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -281,20 +281,21 @@ mod tests {
#[cfg(feature = "nightly")]
#[bench]
fn giver_queue_throughput(b: &mut test::Bencher) {
let (mut tx, mut rx) = super::channel::<i32, ()>();
use {Body, Request, Response};
let (mut tx, mut rx) = super::channel::<Request<Body>, Response<Body>>();

b.iter(move || {
::futures::future::lazy(|| {
let _ = tx.send(1).unwrap();
let _ = tx.send(Request::default()).unwrap();
loop {
let async = rx.poll().unwrap();
if async.is_not_ready() {
let ok = rx.poll().unwrap();
if ok.is_not_ready() {
break;
}
}


Ok::<(), ()>(())
Ok::<_, ()>(())
}).wait().unwrap();
})
}
Expand Down

0 comments on commit ce2b540

Please sign in to comment.