chore(client): adjust dispatch giver throughput benchmark generics

This commit is contained in:
Sean McArthur
2019-02-25 17:35:46 -08:00
parent 1e6603353e
commit ce2b540f9d

View File

@@ -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();
})
}