Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(dependencies): update tokio, h2, and tower-make #1947

Merged
merged 1 commit into from
Sep 23, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,21 +27,21 @@ futures-util-preview = { version = "=0.3.0-alpha.18" }
http = "0.1.15"
http-body = "=0.2.0-alpha.1"
httparse = "1.0"
h2 = "=0.2.0-alpha.1"
h2 = "=0.2.0-alpha.2"
iovec = "0.1"
itoa = "0.4.1"
log = "0.4"
net2 = { version = "0.2.32", optional = true }
pin-project = { version = "=0.4.0-alpha.11", features = ["project_attr"] }
time = "0.1"
tokio = { version = "=0.2.0-alpha.4", optional = true, default-features = false, features = ["rt-full"] }
tokio = { version = "=0.2.0-alpha.5", optional = true, default-features = false, features = ["rt-full"] }
tower-service = "=0.3.0-alpha.1"
tower-make = { version = "=0.1.0-alpha.2", features = ['io'] }
tokio-executor = { version = "=0.2.0-alpha.4", features = ["blocking"] }
tokio-io = "=0.2.0-alpha.4"
tokio-sync = "=0.2.0-alpha.4"
tokio-net = { version = "=0.2.0-alpha.4", optional = true, features = ["tcp"] }
tokio-timer = { version = "=0.3.0-alpha.4", optional = true }
tower-make = { version = "=0.3.0-alpha.2", features = ['io'] }
tokio-executor = { version = "=0.2.0-alpha.5", features = ["blocking"] }
tokio-io = "=0.2.0-alpha.5"
tokio-sync = "=0.2.0-alpha.5"
tokio-net = { version = "=0.2.0-alpha.5", optional = true, features = ["tcp"] }
tokio-timer = { version = "=0.3.0-alpha.5", optional = true }
want = "0.3"

[dev-dependencies]
Expand All @@ -52,9 +52,9 @@ spmc = "0.3"
serde = "1.0"
serde_derive = "1.0"
serde_json = "1.0"
tokio = "=0.2.0-alpha.4" # using #[tokio::test] attributes
tokio-fs = "=0.2.0-alpha.4"
tokio-test = "=0.2.0-alpha.4"
tokio = "=0.2.0-alpha.5" # using #[tokio::test] attributes
tokio-fs = "=0.2.0-alpha.5"
tokio-test = "=0.2.0-alpha.5"
url = "1.0"

[features]
Expand Down
2 changes: 1 addition & 1 deletion src/client/connect/http.rs
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@ impl ConnectingTcp {
local_addr,
preferred: ConnectingTcpRemote::new(preferred_addrs),
fallback: Some(ConnectingTcpFallback {
delay: tokio_timer::sleep(fallback_timeout),
delay: tokio_timer::delay_for(fallback_timeout),
remote: ConnectingTcpRemote::new(fallback_addrs),
}),
reuse_address,
Expand Down
2 changes: 1 addition & 1 deletion src/server/tcp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ impl AddrIncoming {
error!("accept error: {}", e);

// Sleep 1s.
let mut timeout = tokio_timer::sleep(Duration::from_secs(1));
let mut timeout = tokio_timer::delay_for(Duration::from_secs(1));

match Pin::new(&mut timeout).poll(cx) {
Poll::Ready(()) => {
Expand Down
34 changes: 17 additions & 17 deletions tests/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -974,7 +974,7 @@ mod dispatch_impl {
.unwrap();
let res = client.request(req).map_ok(move |res| {
assert_eq!(res.status(), hyper::StatusCode::OK);
tokio_timer::sleep(Duration::from_secs(1))
tokio_timer::delay_for(Duration::from_secs(1))
});
let rx = rx1.expect("thread panicked");
rt.block_on(future::join(res, rx).map(|r| r.0)).unwrap();
Expand Down Expand Up @@ -1018,7 +1018,7 @@ mod dispatch_impl {
assert_eq!(res.status(), hyper::StatusCode::OK);
res.into_body().try_concat()
}).map_ok(|_| {
tokio_timer::sleep(Duration::from_secs(1))
tokio_timer::delay_for(Duration::from_secs(1))
})
};
// client is dropped
Expand Down Expand Up @@ -1082,7 +1082,7 @@ mod dispatch_impl {
}
drop(client);

let t = tokio_timer::sleep(Duration::from_millis(100))
let t = tokio_timer::delay_for(Duration::from_millis(100))
.map(|_| panic!("time out"));
let close = closes
.into_future()
Expand Down Expand Up @@ -1131,7 +1131,7 @@ mod dispatch_impl {
rt.block_on(future::select(res, rx1));

// res now dropped
let t = tokio_timer::sleep(Duration::from_millis(100))
let t = tokio_timer::delay_for(Duration::from_millis(100))
.map(|_| panic!("time out"));
let close = closes
.into_future()
Expand Down Expand Up @@ -1180,7 +1180,7 @@ mod dispatch_impl {
let rx = rx1.expect("thread panicked");
rt.block_on(future::join(res, rx).map(|r| r.0)).unwrap();

let t = tokio_timer::sleep(Duration::from_millis(100))
let t = tokio_timer::delay_for(Duration::from_millis(100))
.map(|_| panic!("time out"));
let close = closes
.into_future()
Expand Down Expand Up @@ -1230,7 +1230,7 @@ mod dispatch_impl {
let rx = rx1.expect("thread panicked");
rt.block_on(future::join(res, rx).map(|r| r.0)).unwrap();

let t = tokio_timer::sleep(Duration::from_millis(100))
let t = tokio_timer::delay_for(Duration::from_millis(100))
.map(|_| panic!("time out"));
let close = closes
.into_future()
Expand Down Expand Up @@ -1274,7 +1274,7 @@ mod dispatch_impl {
let rx = rx1.expect("thread panicked");
rt.block_on(future::join(res, rx).map(|r| r.0)).unwrap();

let t = tokio_timer::sleep(Duration::from_millis(100))
let t = tokio_timer::delay_for(Duration::from_millis(100))
.map(|_| panic!("time out"));
let close = closes
.into_future()
Expand Down Expand Up @@ -1469,7 +1469,7 @@ mod dispatch_impl {
assert_eq!(connects.load(Ordering::Relaxed), 0);

let delayed_body = rx1
.then(|_| tokio_timer::sleep(Duration::from_millis(200)))
.then(|_| tokio_timer::delay_for(Duration::from_millis(200)))
.map(|_| Ok::<_, ()>("hello a"))
.map_err(|_| -> hyper::Error { panic!("rx1") })
.into_stream();
Expand All @@ -1484,7 +1484,7 @@ mod dispatch_impl {

// req 1
let fut = future::join(client.request(req), rx)
.then(|_| tokio_timer::sleep(Duration::from_millis(200)))
.then(|_| tokio_timer::delay_for(Duration::from_millis(200)))
// req 2
.then(move |()| {
let rx = rx3.expect("thread panicked");
Expand Down Expand Up @@ -1838,7 +1838,7 @@ mod conn {
res.into_body().try_concat()
});
let rx = rx1.expect("thread panicked");
let rx = rx.then(|_| tokio_timer::sleep(Duration::from_millis(200)));
let rx = rx.then(|_| tokio_timer::delay_for(Duration::from_millis(200)));
rt.block_on(future::join(res, rx).map(|r| r.0)).unwrap();
}

Expand Down Expand Up @@ -1884,7 +1884,7 @@ mod conn {
});

let rx = rx1.expect("thread panicked");
let rx = rx.then(|_| tokio_timer::sleep(Duration::from_millis(200)));
let rx = rx.then(|_| tokio_timer::delay_for(Duration::from_millis(200)));
let chunk = rt.block_on(future::join(res, rx).map(|r| r.0)).unwrap();
assert_eq!(chunk.len(), 5);
}
Expand Down Expand Up @@ -1976,7 +1976,7 @@ mod conn {
res.into_body().try_concat()
});
let rx = rx1.expect("thread panicked");
let rx = rx.then(|_| tokio_timer::sleep(Duration::from_millis(200)));
let rx = rx.then(|_| tokio_timer::delay_for(Duration::from_millis(200)));
rt.block_on(future::join(res, rx).map(|r| r.0)).unwrap();
}

Expand Down Expand Up @@ -2020,7 +2020,7 @@ mod conn {
res.into_body().try_concat()
});
let rx = rx1.expect("thread panicked");
let rx = rx.then(|_| tokio_timer::sleep(Duration::from_millis(200)));
let rx = rx.then(|_| tokio_timer::delay_for(Duration::from_millis(200)));
rt.block_on(future::join(res, rx).map(|r| r.0)).unwrap();
}

Expand Down Expand Up @@ -2072,7 +2072,7 @@ mod conn {
});

let rx = rx1.expect("thread panicked");
let rx = rx.then(|_| tokio_timer::sleep(Duration::from_millis(200)));
let rx = rx.then(|_| tokio_timer::delay_for(Duration::from_millis(200)));
rt.block_on(future::join3(res1, res2, rx).map(|r| r.0)).unwrap();
}

Expand Down Expand Up @@ -2132,7 +2132,7 @@ mod conn {
});

let rx = rx1.expect("thread panicked");
let rx = rx.then(|_| tokio_timer::sleep(Duration::from_millis(200)));
let rx = rx.then(|_| tokio_timer::delay_for(Duration::from_millis(200)));
rt.block_on(future::join3(until_upgrade, res, rx).map(|r| r.0)).unwrap();

// should not be ready now
Expand Down Expand Up @@ -2220,7 +2220,7 @@ mod conn {
});

let rx = rx1.expect("thread panicked");
let rx = rx.then(|_| tokio_timer::sleep(Duration::from_millis(200)));
let rx = rx.then(|_| tokio_timer::delay_for(Duration::from_millis(200)));
rt.block_on(future::join3(until_tunneled, res, rx).map(|r| r.0)).unwrap();

// should not be ready now
Expand Down Expand Up @@ -2296,7 +2296,7 @@ mod conn {
let _ = shdn_tx.send(());

// Allow time for graceful shutdown roundtrips...
rt.block_on(tokio_timer::sleep(Duration::from_millis(100)));
rt.block_on(tokio_timer::delay_for(Duration::from_millis(100)));

// After graceful shutdown roundtrips, the client should be closed...
rt.block_on(future::poll_fn(|ctx| client.poll_ready(ctx))).expect_err("client should be closed");
Expand Down
6 changes: 3 additions & 3 deletions tests/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -937,7 +937,7 @@ fn disable_keep_alive_post_request() {
// the read-blocked socket.
//
// See https://github.com/carllerche/mio/issues/776
let timeout = tokio_timer::sleep(Duration::from_millis(10));
let timeout = tokio_timer::delay_for(Duration::from_millis(10));
rt.block_on(timeout);
assert!(dropped.load());
child.join().unwrap();
Expand Down Expand Up @@ -1006,7 +1006,7 @@ fn socket_half_closed() {
.map_err(|_| unreachable!())
.and_then(|socket| {
Http::new().serve_connection(socket, service_fn(|_| {
tokio_timer::sleep(Duration::from_millis(500))
tokio_timer::delay_for(Duration::from_millis(500))
.map(|_| Ok::<_, hyper::Error>(Response::new(Body::empty())))
}))
});
Expand Down Expand Up @@ -1034,7 +1034,7 @@ fn disconnect_after_reading_request_before_responding() {
Http::new()
.http1_half_close(false)
.serve_connection(socket, service_fn(|_| {
tokio_timer::sleep(Duration::from_secs(2))
tokio_timer::delay_for(Duration::from_secs(2))
.map(|_| -> Result<Response<Body>, hyper::Error> {
panic!("response future should have been dropped");
})
Expand Down