Skip to content

Commit 7e8b28b

Browse files
committed
chore(dependencies): update tokio, h2, and tower-make
1 parent dc54ee1 commit 7e8b28b

File tree

5 files changed

+33
-33
lines changed

5 files changed

+33
-33
lines changed

Cargo.toml

+11-11
Original file line numberDiff line numberDiff line change
@@ -27,21 +27,21 @@ futures-util-preview = { version = "=0.3.0-alpha.18" }
2727
http = "0.1.15"
2828
http-body = "=0.2.0-alpha.1"
2929
httparse = "1.0"
30-
h2 = "=0.2.0-alpha.1"
30+
h2 = "=0.2.0-alpha.2"
3131
iovec = "0.1"
3232
itoa = "0.4.1"
3333
log = "0.4"
3434
net2 = { version = "0.2.32", optional = true }
3535
pin-project = { version = "=0.4.0-alpha.11", features = ["project_attr"] }
3636
time = "0.1"
37-
tokio = { version = "=0.2.0-alpha.4", optional = true, default-features = false, features = ["rt-full"] }
37+
tokio = { version = "=0.2.0-alpha.5", optional = true, default-features = false, features = ["rt-full"] }
3838
tower-service = "=0.3.0-alpha.1"
39-
tower-make = { version = "=0.1.0-alpha.2", features = ['io'] }
40-
tokio-executor = { version = "=0.2.0-alpha.4", features = ["blocking"] }
41-
tokio-io = "=0.2.0-alpha.4"
42-
tokio-sync = "=0.2.0-alpha.4"
43-
tokio-net = { version = "=0.2.0-alpha.4", optional = true, features = ["tcp"] }
44-
tokio-timer = { version = "=0.3.0-alpha.4", optional = true }
39+
tower-make = { version = "=0.3.0-alpha.2", features = ['io'] }
40+
tokio-executor = { version = "=0.2.0-alpha.5", features = ["blocking"] }
41+
tokio-io = "=0.2.0-alpha.5"
42+
tokio-sync = "=0.2.0-alpha.5"
43+
tokio-net = { version = "=0.2.0-alpha.5", optional = true, features = ["tcp"] }
44+
tokio-timer = { version = "=0.3.0-alpha.5", optional = true }
4545
want = "0.3"
4646

4747
[dev-dependencies]
@@ -52,9 +52,9 @@ spmc = "0.3"
5252
serde = "1.0"
5353
serde_derive = "1.0"
5454
serde_json = "1.0"
55-
tokio = "=0.2.0-alpha.4" # using #[tokio::test] attributes
56-
tokio-fs = "=0.2.0-alpha.4"
57-
tokio-test = "=0.2.0-alpha.4"
55+
tokio = "=0.2.0-alpha.5" # using #[tokio::test] attributes
56+
tokio-fs = "=0.2.0-alpha.5"
57+
tokio-test = "=0.2.0-alpha.5"
5858
url = "1.0"
5959

6060
[features]

src/client/connect/http.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,7 @@ impl ConnectingTcp {
470470
local_addr,
471471
preferred: ConnectingTcpRemote::new(preferred_addrs),
472472
fallback: Some(ConnectingTcpFallback {
473-
delay: tokio_timer::sleep(fallback_timeout),
473+
delay: tokio_timer::delay_for(fallback_timeout),
474474
remote: ConnectingTcpRemote::new(fallback_addrs),
475475
}),
476476
reuse_address,

src/server/tcp.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ impl AddrIncoming {
135135
error!("accept error: {}", e);
136136

137137
// Sleep 1s.
138-
let mut timeout = tokio_timer::sleep(Duration::from_secs(1));
138+
let mut timeout = tokio_timer::delay_for(Duration::from_secs(1));
139139

140140
match Pin::new(&mut timeout).poll(cx) {
141141
Poll::Ready(()) => {

tests/client.rs

+17-17
Original file line numberDiff line numberDiff line change
@@ -974,7 +974,7 @@ mod dispatch_impl {
974974
.unwrap();
975975
let res = client.request(req).map_ok(move |res| {
976976
assert_eq!(res.status(), hyper::StatusCode::OK);
977-
tokio_timer::sleep(Duration::from_secs(1))
977+
tokio_timer::delay_for(Duration::from_secs(1))
978978
});
979979
let rx = rx1.expect("thread panicked");
980980
rt.block_on(future::join(res, rx).map(|r| r.0)).unwrap();
@@ -1018,7 +1018,7 @@ mod dispatch_impl {
10181018
assert_eq!(res.status(), hyper::StatusCode::OK);
10191019
res.into_body().try_concat()
10201020
}).map_ok(|_| {
1021-
tokio_timer::sleep(Duration::from_secs(1))
1021+
tokio_timer::delay_for(Duration::from_secs(1))
10221022
})
10231023
};
10241024
// client is dropped
@@ -1082,7 +1082,7 @@ mod dispatch_impl {
10821082
}
10831083
drop(client);
10841084

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

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

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

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

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

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

14851485
// req 1
14861486
let fut = future::join(client.request(req), rx)
1487-
.then(|_| tokio_timer::sleep(Duration::from_millis(200)))
1487+
.then(|_| tokio_timer::delay_for(Duration::from_millis(200)))
14881488
// req 2
14891489
.then(move |()| {
14901490
let rx = rx3.expect("thread panicked");
@@ -1838,7 +1838,7 @@ mod conn {
18381838
res.into_body().try_concat()
18391839
});
18401840
let rx = rx1.expect("thread panicked");
1841-
let rx = rx.then(|_| tokio_timer::sleep(Duration::from_millis(200)));
1841+
let rx = rx.then(|_| tokio_timer::delay_for(Duration::from_millis(200)));
18421842
rt.block_on(future::join(res, rx).map(|r| r.0)).unwrap();
18431843
}
18441844

@@ -1884,7 +1884,7 @@ mod conn {
18841884
});
18851885

18861886
let rx = rx1.expect("thread panicked");
1887-
let rx = rx.then(|_| tokio_timer::sleep(Duration::from_millis(200)));
1887+
let rx = rx.then(|_| tokio_timer::delay_for(Duration::from_millis(200)));
18881888
let chunk = rt.block_on(future::join(res, rx).map(|r| r.0)).unwrap();
18891889
assert_eq!(chunk.len(), 5);
18901890
}
@@ -1976,7 +1976,7 @@ mod conn {
19761976
res.into_body().try_concat()
19771977
});
19781978
let rx = rx1.expect("thread panicked");
1979-
let rx = rx.then(|_| tokio_timer::sleep(Duration::from_millis(200)));
1979+
let rx = rx.then(|_| tokio_timer::delay_for(Duration::from_millis(200)));
19801980
rt.block_on(future::join(res, rx).map(|r| r.0)).unwrap();
19811981
}
19821982

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

@@ -2072,7 +2072,7 @@ mod conn {
20722072
});
20732073

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

@@ -2132,7 +2132,7 @@ mod conn {
21322132
});
21332133

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

21382138
// should not be ready now
@@ -2220,7 +2220,7 @@ mod conn {
22202220
});
22212221

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

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

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

23012301
// After graceful shutdown roundtrips, the client should be closed...
23022302
rt.block_on(future::poll_fn(|ctx| client.poll_ready(ctx))).expect_err("client should be closed");

tests/server.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -937,7 +937,7 @@ fn disable_keep_alive_post_request() {
937937
// the read-blocked socket.
938938
//
939939
// See https://github.com/carllerche/mio/issues/776
940-
let timeout = tokio_timer::sleep(Duration::from_millis(10));
940+
let timeout = tokio_timer::delay_for(Duration::from_millis(10));
941941
rt.block_on(timeout);
942942
assert!(dropped.load());
943943
child.join().unwrap();
@@ -1006,7 +1006,7 @@ fn socket_half_closed() {
10061006
.map_err(|_| unreachable!())
10071007
.and_then(|socket| {
10081008
Http::new().serve_connection(socket, service_fn(|_| {
1009-
tokio_timer::sleep(Duration::from_millis(500))
1009+
tokio_timer::delay_for(Duration::from_millis(500))
10101010
.map(|_| Ok::<_, hyper::Error>(Response::new(Body::empty())))
10111011
}))
10121012
});
@@ -1034,7 +1034,7 @@ fn disconnect_after_reading_request_before_responding() {
10341034
Http::new()
10351035
.http1_half_close(false)
10361036
.serve_connection(socket, service_fn(|_| {
1037-
tokio_timer::sleep(Duration::from_secs(2))
1037+
tokio_timer::delay_for(Duration::from_secs(2))
10381038
.map(|_| -> Result<Response<Body>, hyper::Error> {
10391039
panic!("response future should have been dropped");
10401040
})

0 commit comments

Comments
 (0)