From b98b897c8ec95375f00f2aa77752937aea69c828 Mon Sep 17 00:00:00 2001 From: Martell Malone Date: Tue, 26 Nov 2019 19:30:50 -0800 Subject: [PATCH] Update tokio to 0.2 --- actix-connect/Cargo.toml | 2 +- actix-connect/src/connector.rs | 2 +- actix-connect/src/lib.rs | 2 +- actix-connect/src/service.rs | 2 +- actix-connect/src/ssl/openssl.rs | 2 +- actix-connect/tests/test_connect.rs | 12 ++++++------ actix-ioframe/Cargo.toml | 2 +- actix-ioframe/tests/test_server.rs | 2 +- actix-rt/Cargo.toml | 5 +---- actix-rt/src/builder.rs | 4 ++-- actix-rt/src/runtime.rs | 4 ++-- actix-server/src/signals.rs | 4 ++-- actix-testing/Cargo.toml | 2 +- actix-testing/src/lib.rs | 4 ++-- 14 files changed, 23 insertions(+), 26 deletions(-) diff --git a/actix-connect/Cargo.toml b/actix-connect/Cargo.toml index e7c0092b..68df4a48 100644 --- a/actix-connect/Cargo.toml +++ b/actix-connect/Cargo.toml @@ -42,7 +42,7 @@ either = "1.5.2" futures = "0.3.1" http = { version = "0.1.17", optional = true } log = "0.4" -tokio-net = "=0.2.0-alpha.6" +tokio = { version = "0.2", features = ["net"] } trust-dns-resolver = { version="0.18.0-alpha.1", default-features = false } # openssl diff --git a/actix-connect/src/connector.rs b/actix-connect/src/connector.rs index b8c54eeb..36a9b8d5 100644 --- a/actix-connect/src/connector.rs +++ b/actix-connect/src/connector.rs @@ -8,7 +8,7 @@ use std::task::{Context, Poll}; use actix_service::{Service, ServiceFactory}; use futures::future::{err, ok, BoxFuture, Either, FutureExt, Ready}; -use tokio_net::tcp::TcpStream; +use tokio::net::tcp::TcpStream; use super::connect::{Address, Connect, Connection}; use super::error::ConnectError; diff --git a/actix-connect/src/lib.rs b/actix-connect/src/lib.rs index a7d276ef..8bc6d1ec 100644 --- a/actix-connect/src/lib.rs +++ b/actix-connect/src/lib.rs @@ -22,7 +22,7 @@ mod uri; use actix_rt::Arbiter; use actix_service::{pipeline, pipeline_factory, Service, ServiceFactory}; -use tokio_net::tcp::TcpStream; +use tokio::net::tcp::TcpStream; pub use trust_dns_resolver::config::{ResolverConfig, ResolverOpts}; pub use trust_dns_resolver::system_conf::read_system_conf; diff --git a/actix-connect/src/service.rs b/actix-connect/src/service.rs index 65fa6d53..50c8400f 100644 --- a/actix-connect/src/service.rs +++ b/actix-connect/src/service.rs @@ -5,7 +5,7 @@ use std::task::{Context, Poll}; use actix_service::{Service, ServiceFactory}; use either::Either; use futures::future::{ok, Ready}; -use tokio_net::tcp::TcpStream; +use tokio::net::tcp::TcpStream; use trust_dns_resolver::AsyncResolver; use crate::connect::{Address, Connect, Connection}; diff --git a/actix-connect/src/ssl/openssl.rs b/actix-connect/src/ssl/openssl.rs index 6cbe3d62..9b21f9c4 100644 --- a/actix-connect/src/ssl/openssl.rs +++ b/actix-connect/src/ssl/openssl.rs @@ -8,7 +8,7 @@ use actix_codec::{AsyncRead, AsyncWrite}; use actix_service::{Service, ServiceFactory}; use futures::future::{err, ok, Either, FutureExt, LocalBoxFuture, Ready}; use open_ssl::ssl::SslConnector; -use tokio_net::tcp::TcpStream; +use tokio::net::tcp::TcpStream; use tokio_openssl::{HandshakeError, SslStream}; use trust_dns_resolver::AsyncResolver; diff --git a/actix-connect/tests/test_connect.rs b/actix-connect/tests/test_connect.rs index b1ff8f2a..cced4f95 100644 --- a/actix-connect/tests/test_connect.rs +++ b/actix-connect/tests/test_connect.rs @@ -14,7 +14,7 @@ use actix_connect::Connect; #[actix_rt::test] async fn test_string() { let srv = TestServer::with(|| { - service_fn(|io: Io| { + service_fn(|io: Io| { async { let mut framed = Framed::new(io.into_parts().0, BytesCodec); framed.send(Bytes::from_static(b"test")).await?; @@ -33,7 +33,7 @@ async fn test_string() { #[actix_rt::test] async fn test_rustls_string() { let srv = TestServer::with(|| { - service_fn(|io: Io| { + service_fn(|io: Io| { async { let mut framed = Framed::new(io.into_parts().0, BytesCodec); framed.send(Bytes::from_static(b"test")).await?; @@ -51,7 +51,7 @@ async fn test_rustls_string() { #[actix_rt::test] async fn test_static_str() { let srv = TestServer::with(|| { - service_fn(|io: Io| { + service_fn(|io: Io| { async { let mut framed = Framed::new(io.into_parts().0, BytesCodec); framed.send(Bytes::from_static(b"test")).await?; @@ -75,7 +75,7 @@ async fn test_static_str() { #[actix_rt::test] async fn test_new_service() { let srv = TestServer::with(|| { - service_fn(|io: Io| { + service_fn(|io: Io| { async { let mut framed = Framed::new(io.into_parts().0, BytesCodec); framed.send(Bytes::from_static(b"test")).await?; @@ -100,7 +100,7 @@ async fn test_uri() { use http::HttpTryFrom; let srv = TestServer::with(|| { - service_fn(|io: Io| { + service_fn(|io: Io| { async { let mut framed = Framed::new(io.into_parts().0, BytesCodec); framed.send(Bytes::from_static(b"test")).await?; @@ -121,7 +121,7 @@ async fn test_rustls_uri() { use http::HttpTryFrom; let srv = TestServer::with(|| { - service_fn(|io: Io| { + service_fn(|io: Io| { async { let mut framed = Framed::new(io.into_parts().0, BytesCodec); framed.send(Bytes::from_static(b"test")).await?; diff --git a/actix-ioframe/Cargo.toml b/actix-ioframe/Cargo.toml index e194823b..37023444 100644 --- a/actix-ioframe/Cargo.toml +++ b/actix-ioframe/Cargo.toml @@ -32,4 +32,4 @@ log = "0.4" actix-connect = "1.0.0-alpha.1" actix-testing = "0.3.0-alpha.1" actix-server-config = "0.3.0-alpha.1" -tokio-net = "=0.2.0-alpha.6" +tokio = { version = "0.2", features = ["net"] } diff --git a/actix-ioframe/tests/test_server.rs b/actix-ioframe/tests/test_server.rs index 98c95eb5..bffe2280 100644 --- a/actix-ioframe/tests/test_server.rs +++ b/actix-ioframe/tests/test_server.rs @@ -8,7 +8,7 @@ use actix_server_config::Io; use actix_service::{apply_fn_factory, service_fn, Service}; use actix_testing::TestServer; use futures::future::ok; -use tokio_net::tcp::TcpStream; +use tokio::net::tcp::TcpStream; use actix_ioframe::{Builder, Connect}; diff --git a/actix-rt/Cargo.toml b/actix-rt/Cargo.toml index 6638316a..44c4bbc6 100644 --- a/actix-rt/Cargo.toml +++ b/actix-rt/Cargo.toml @@ -22,9 +22,6 @@ actix-macros = "0.1.0-alpha.1" actix-threadpool = "0.2" futures = "0.3.1" -tokio = "=0.2.0-alpha.6" -tokio-executor = "=0.2.0-alpha.6" -tokio-net = "=0.2.0-alpha.6" -tokio-timer = "=0.3.0-alpha.6" +tokio = { version = "0.2", features = ["net", "time"] } copyless = "0.1.4" diff --git a/actix-rt/src/builder.rs b/actix-rt/src/builder.rs index 8814decf..c9e4a250 100644 --- a/actix-rt/src/builder.rs +++ b/actix-rt/src/builder.rs @@ -7,8 +7,8 @@ use futures::future::{lazy, Future, FutureExt}; use tokio::runtime::current_thread::Handle; use tokio_executor::current_thread::CurrentThread; -use tokio_net::driver::Reactor; -use tokio_timer::{clock::Clock, timer::Timer}; +use tokio::net::driver::Reactor; +use tokio::time::{clock::Clock, timer::Timer}; use crate::arbiter::{Arbiter, SystemArbiter}; use crate::runtime::Runtime; diff --git a/actix-rt/src/runtime.rs b/actix-rt/src/runtime.rs index 8e3c6f7b..3788cb81 100644 --- a/actix-rt/src/runtime.rs +++ b/actix-rt/src/runtime.rs @@ -3,7 +3,7 @@ use std::{fmt, io}; use futures::Future; use tokio_executor::current_thread::{self, CurrentThread}; -use tokio_net::driver::{Handle as ReactorHandle, Reactor}; +use tokio::net::driver::{Handle as ReactorHandle, Reactor}; use tokio_timer::{ clock::Clock, timer::{self, Timer}, @@ -152,7 +152,7 @@ impl Runtime { // automatically inside its `block_on` and `run` methods tokio_executor::with_default(&mut current_thread::TaskExecutor::current(), || { tokio_timer::clock::with_default(clock, || { - let _reactor_guard = tokio_net::driver::set_default(reactor_handle); + let _reactor_guard = tokio::net::driver::set_default(reactor_handle); let _timer_guard = tokio_timer::set_default(timer_handle); f(executor) }) diff --git a/actix-server/src/signals.rs b/actix-server/src/signals.rs index 34c982ae..f7ac0ebd 100644 --- a/actix-server/src/signals.rs +++ b/actix-server/src/signals.rs @@ -21,7 +21,7 @@ pub(crate) enum Signal { pub(crate) struct Signals { srv: Server, #[cfg(not(unix))] - stream: tokio_net::signal::CtrlC, + stream: tokio::net::signal::CtrlC, #[cfg(unix)] streams: Vec<(Signal, tokio::signal::unix::Signal)>, } @@ -31,7 +31,7 @@ impl Signals { actix_rt::spawn({ #[cfg(not(unix))] { - let stream = tokio_net::signal::ctrl_c()?; + let stream = tokio::net::signal::ctrl_c()?; Signals { srv, stream } } diff --git a/actix-testing/Cargo.toml b/actix-testing/Cargo.toml index e199d568..252b4b96 100644 --- a/actix-testing/Cargo.toml +++ b/actix-testing/Cargo.toml @@ -26,4 +26,4 @@ actix-service = "1.0.0-alpha.1" log = "0.4" net2 = "0.2" futures = "0.3.1" -tokio-net = { version = "0.2.0-alpha.6" } +tokio = { version = "0.2", features = ["net"] } diff --git a/actix-testing/src/lib.rs b/actix-testing/src/lib.rs index e2541404..f5730a9a 100644 --- a/actix-testing/src/lib.rs +++ b/actix-testing/src/lib.rs @@ -7,8 +7,8 @@ use actix_server::{Server, ServerBuilder, ServiceFactory}; pub use actix_server_config::{Io, ServerConfig}; use net2::TcpBuilder; -use tokio_net::driver::Handle; -use tokio_net::tcp::TcpStream; +use tokio::net::driver::Handle; +use tokio::net::tcp::TcpStream; #[cfg(not(test))] // Work around for rust-lang/rust#62127 pub use actix_macros::test;