Skip to content

Commit 4920f5e

Browse files
DoumanAshseanmonstar
authored andcommitted
chore(dependencies): Upgrade tokio
1 parent c1d40f3 commit 4920f5e

File tree

8 files changed

+28
-34
lines changed

8 files changed

+28
-34
lines changed

Cargo.toml

+9-13
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,13 @@ log = "0.4"
3636
net2 = { version = "0.2.32", optional = true }
3737
pin-utils = "0.1.0-alpha.4"
3838
time = "0.1"
39-
tokio = { version = "0.2.0-alpha.1", optional = true, default-features = false, features = ["rt-full"] }
39+
tokio = { version = "0.2.0-alpha.2", optional = true, default-features = false, features = ["rt-full"] }
4040
tokio-buf = "0.2.0-alpha.1"
41-
tokio-executor = "0.2.0-alpha.1"
42-
tokio-io = "0.2.0-alpha.1"
43-
tokio-reactor = { version = "0.2.0-alpha.1", optional = true }
44-
tokio-sync = "0.2.0-alpha.1"
45-
tokio-tcp = { version = "0.2.0-alpha.1", optional = true, features = ["async-traits"] }
46-
tokio-threadpool = { version = "0.2.0-alpha.1", optional = true }
47-
tokio-timer = { version = "0.3.0-alpha.1", optional = true }
41+
tokio-executor = "0.2.0-alpha.2"
42+
tokio-io = "0.2.0-alpha.2"
43+
tokio-sync = "0.2.0-alpha.2"
44+
tokio-net = { version = "0.2.0-alpha.2", optional = true, features = ["tcp"] }
45+
tokio-timer = { version = "0.3.0-alpha.2", optional = true }
4846
want = { git = "https://github.com/seanmonstar/want", branch = "std-future" }
4947

5048
[dev-dependencies]
@@ -55,8 +53,8 @@ spmc = "0.3"
5553
serde = "1.0"
5654
serde_derive = "1.0"
5755
serde_json = "1.0"
58-
tokio-fs = "0.2.0-alpha.1"
59-
tokio-test = "0.2.0-alpha.1"
56+
tokio-fs = "0.2.0-alpha.2"
57+
tokio-test = "0.2.0-alpha.2"
6058
url = "1.0"
6159

6260

@@ -68,9 +66,7 @@ default = [
6866
runtime = [
6967
"net2",
7068
"tokio",
71-
"tokio-reactor",
72-
"tokio-tcp",
73-
"tokio-threadpool",
69+
"tokio-net",
7470
"tokio-timer",
7571
]
7672
nightly = []

src/client/connect/dns.rs

+5-6
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ use std::sync::Arc;
1919
use futures_util::{FutureExt, StreamExt};
2020
use tokio_executor::TypedExecutor;
2121
use tokio_sync::{mpsc, oneshot};
22-
use tokio_threadpool;
2322

2423
use crate::common::{Future, Never, Pin, Poll, Unpin, task};
2524

@@ -42,7 +41,7 @@ pub struct Name {
4241
/// A resolver using blocking `getaddrinfo` calls in a threadpool.
4342
#[derive(Clone)]
4443
pub struct GaiResolver {
45-
tx: tokio_threadpool::Sender,
44+
tx: tokio_executor::threadpool::Sender,
4645
/// A handle to keep the threadpool alive until all `GaiResolver` clones
4746
/// have been dropped.
4847
_threadpool_keep_alive: ThreadPoolKeepAlive,
@@ -114,7 +113,7 @@ impl GaiResolver {
114113
///
115114
/// Takes number of DNS worker threads.
116115
pub fn new(threads: usize) -> Self {
117-
let pool = tokio_threadpool::Builder::new()
116+
let pool = tokio_executor::threadpool::Builder::new()
118117
.name_prefix("hyper-dns-gai-resolver")
119118
// not for CPU tasks, so only spawn workers
120119
// in blocking mode
@@ -296,7 +295,7 @@ impl Iterator for IpAddrs {
296295
}
297296
}
298297

299-
/// A resolver using `getaddrinfo` calls via the `tokio_threadpool::blocking` API.
298+
/// A resolver using `getaddrinfo` calls via the `tokio_executor::threadpool::blocking` API.
300299
///
301300
/// Unlike the `GaiResolver` this will not spawn dedicated threads, but only works when running on the
302301
/// multi-threaded Tokio runtime.
@@ -332,10 +331,10 @@ impl Future for TokioThreadpoolGaiFuture {
332331
type Output = Result<GaiAddrs, io::Error>;
333332

334333
fn poll(mut self: Pin<&mut Self>, cx: &mut task::Context<'_>) -> Poll<Self::Output> {
335-
match ready!(tokio_threadpool::blocking(|| (self.name.as_str(), 0).to_socket_addrs())) {
334+
match ready!(tokio_executor::threadpool::blocking(|| (self.name.as_str(), 0).to_socket_addrs())) {
336335
Ok(Ok(iter)) => Poll::Ready(Ok(GaiAddrs { inner: IpAddrs { iter } })),
337336
Ok(Err(e)) => Poll::Ready(Err(e)),
338-
// a BlockingError, meaning not on a tokio_threadpool :(
337+
// a BlockingError, meaning not on a tokio_executor::threadpool :(
339338
Err(e) => Poll::Ready(Err(io::Error::new(io::ErrorKind::Other, e))),
340339
}
341340
}

src/client/connect/http.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ use std::time::{Duration, Instant};
88

99
use http::uri::Scheme;
1010
use net2::TcpBuilder;
11-
use tokio_reactor::Handle;
12-
use tokio_tcp::{TcpStream/*, ConnectFuture*/};
11+
use tokio_net::driver::Handle;
12+
use tokio_net::tcp::{TcpStream/*, ConnectFuture*/};
1313
use tokio_timer::Delay;
1414

1515
use crate::common::{Future, Pin, Poll, task};
@@ -623,7 +623,7 @@ mod tests {
623623
624624
use futures::{Async, Poll};
625625
use tokio::runtime::current_thread::Runtime;
626-
use tokio_reactor::Handle;
626+
use tokio_net::driver::Handle;
627627
628628
use super::dns;
629629
use super::ConnectingTcp;

src/server/conn.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ use futures_core::Stream;
2020
use h2;
2121
use pin_utils::{unsafe_pinned, unsafe_unpinned};
2222
use tokio_io::{AsyncRead, AsyncWrite};
23-
#[cfg(feature = "runtime")] use tokio_reactor::Handle;
23+
#[cfg(feature = "runtime")] use tokio_net::driver::Handle;
2424

2525
use crate::body::{Body, Payload};
2626
use crate::common::exec::{Exec, H2Exec, NewSvcExec};

src/server/mod.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ use std::fmt;
6262
use futures_core::Stream;
6363
use pin_utils::unsafe_pinned;
6464
use tokio_io::{AsyncRead, AsyncWrite};
65-
#[cfg(feature = "runtime")] use tokio_reactor;
6665

6766
use crate::body::{Body, Payload};
6867
use crate::common::exec::{Exec, H2Exec, NewSvcExec};
@@ -132,7 +131,7 @@ impl Server<AddrIncoming, ()> {
132131

133132
/// Create a new instance from a `std::net::TcpListener` instance.
134133
pub fn from_tcp(listener: StdTcpListener) -> Result<Builder<AddrIncoming>, crate::Error> {
135-
let handle = tokio_reactor::Handle::default();
134+
let handle = tokio_net::driver::Handle::default();
136135
AddrIncoming::from_std(listener, &handle)
137136
.map(Server::builder)
138137
}

src/server/tcp.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ use std::time::{Duration, Instant};
55

66
use futures_core::Stream;
77
use futures_util::FutureExt as _;
8-
use tokio_reactor::Handle;
9-
use tokio_tcp::TcpListener;
8+
use tokio_net::driver::Handle;
9+
use tokio_net::tcp::TcpListener;
1010
use tokio_timer::Delay;
1111

1212
use crate::common::{Future, Pin, Poll, task};
@@ -196,7 +196,7 @@ mod addr_stream {
196196
use std::io;
197197
use std::net::SocketAddr;
198198
use bytes::{Buf, BufMut};
199-
use tokio_tcp::TcpStream;
199+
use tokio_net::tcp::TcpStream;
200200
use tokio_io::{AsyncRead, AsyncWrite};
201201

202202
use crate::common::{Pin, Poll, task};

tests/client.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ extern crate net2;
77
extern crate pretty_env_logger;
88
extern crate tokio;
99
extern crate tokio_io;
10-
extern crate tokio_tcp;
10+
extern crate tokio_net;
1111
extern crate tokio_timer;
1212

1313
use std::io::{Read, Write};
@@ -25,7 +25,7 @@ use futures_util::future::{self, FutureExt};
2525
use futures_util::try_future::{self, TryFutureExt};
2626
use futures_util::try_stream::TryStreamExt;
2727
use tokio::runtime::current_thread::Runtime;
28-
use tokio_tcp::TcpStream;
28+
use tokio_net::tcp::TcpStream;
2929

3030
fn s(buf: &[u8]) -> &str {
3131
::std::str::from_utf8(buf).expect("from_utf8")
@@ -773,7 +773,7 @@ mod dispatch_impl {
773773
use futures_util::try_stream::TryStreamExt;
774774
use tokio::runtime::current_thread::Runtime;
775775
use tokio_io::{AsyncRead, AsyncWrite};
776-
use tokio_tcp::TcpStream;
776+
use tokio_net::tcp::TcpStream;
777777
use tokio_timer::Delay;
778778

779779
use hyper::client::connect::{Connect, Connected, Destination, HttpConnector};
@@ -1635,7 +1635,7 @@ mod conn {
16351635
use futures_util::try_stream::TryStreamExt;
16361636
use tokio::runtime::current_thread::Runtime;
16371637
use tokio_io::{AsyncRead, AsyncWrite};
1638-
use tokio_tcp::TcpStream;
1638+
use tokio_net::tcp::TcpStream;
16391639
use tokio_timer::Delay;
16401640

16411641
use hyper::{self, Request, Body, Method};

tests_disabled/server.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ extern crate spmc;
1010
extern crate pretty_env_logger;
1111
extern crate tokio;
1212
extern crate tokio_io;
13-
extern crate tokio_tcp;
13+
extern crate tokio_net;
1414

1515
use std::net::{TcpStream, Shutdown, SocketAddr};
1616
use std::io::{self, Read, Write};
@@ -26,7 +26,7 @@ use futures::future::{self, FutureResult, Either};
2626
use futures::sync::oneshot;
2727
use futures_timer::Delay;
2828
use http::header::{HeaderName, HeaderValue};
29-
use tokio_tcp::{TcpListener, TcpStream as TkTcpStream};
29+
use tokio_net::tcp::{TcpListener, TcpStream as TkTcpStream};
3030
use tokio::runtime::current_thread::Runtime;
3131
use tokio::reactor::Handle;
3232
use tokio_io::{AsyncRead, AsyncWrite};

0 commit comments

Comments
 (0)