feat(lib): update Tokio, bytes, http, h2, and http-body

This commit is contained in:
Sean McArthur
2019-12-03 14:36:20 -08:00
parent 131962c86a
commit cb3f39c2dc
51 changed files with 985 additions and 1305 deletions

View File

@@ -9,7 +9,6 @@ use std::sync::mpsc;
use std::time::Duration;
use futures_util::{stream, StreamExt};
use tokio::runtime::current_thread;
use tokio::sync::oneshot;
use hyper::{Body, Response, Server};
@@ -33,8 +32,17 @@ macro_rules! bench_server {
)
}))
});
let srv = Server::bind(&addr)
.serve(make_svc);
let mut rt = tokio::runtime::Builder::new()
.enable_all()
.basic_scheduler()
.build()
.expect("rt build");
let srv = rt.block_on(async move {
Server::bind(&addr)
.serve(make_svc)
});
addr_tx.send(srv.local_addr()).unwrap();
@@ -42,13 +50,11 @@ macro_rules! bench_server {
.with_graceful_shutdown(async {
until_rx.await.ok();
});
let mut rt = current_thread::Runtime::new().unwrap();
rt.spawn(async {
rt.block_on(async move {
if let Err(e) = graceful.await {
panic!("server error: {}", e);
}
});
rt.run().unwrap();
});
addr_rx.recv().unwrap()