Update tokio to 0.2

This commit is contained in:
Martell Malone 2019-11-26 19:30:50 -08:00
parent 4d67682cff
commit b98b897c8e
14 changed files with 23 additions and 26 deletions

View File

@ -42,7 +42,7 @@ either = "1.5.2"
futures = "0.3.1" futures = "0.3.1"
http = { version = "0.1.17", optional = true } http = { version = "0.1.17", optional = true }
log = "0.4" 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 } trust-dns-resolver = { version="0.18.0-alpha.1", default-features = false }
# openssl # openssl

View File

@ -8,7 +8,7 @@ use std::task::{Context, Poll};
use actix_service::{Service, ServiceFactory}; use actix_service::{Service, ServiceFactory};
use futures::future::{err, ok, BoxFuture, Either, FutureExt, Ready}; 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::connect::{Address, Connect, Connection};
use super::error::ConnectError; use super::error::ConnectError;

View File

@ -22,7 +22,7 @@ mod uri;
use actix_rt::Arbiter; use actix_rt::Arbiter;
use actix_service::{pipeline, pipeline_factory, Service, ServiceFactory}; 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::config::{ResolverConfig, ResolverOpts};
pub use trust_dns_resolver::system_conf::read_system_conf; pub use trust_dns_resolver::system_conf::read_system_conf;

View File

@ -5,7 +5,7 @@ use std::task::{Context, Poll};
use actix_service::{Service, ServiceFactory}; use actix_service::{Service, ServiceFactory};
use either::Either; use either::Either;
use futures::future::{ok, Ready}; use futures::future::{ok, Ready};
use tokio_net::tcp::TcpStream; use tokio::net::tcp::TcpStream;
use trust_dns_resolver::AsyncResolver; use trust_dns_resolver::AsyncResolver;
use crate::connect::{Address, Connect, Connection}; use crate::connect::{Address, Connect, Connection};

View File

@ -8,7 +8,7 @@ use actix_codec::{AsyncRead, AsyncWrite};
use actix_service::{Service, ServiceFactory}; use actix_service::{Service, ServiceFactory};
use futures::future::{err, ok, Either, FutureExt, LocalBoxFuture, Ready}; use futures::future::{err, ok, Either, FutureExt, LocalBoxFuture, Ready};
use open_ssl::ssl::SslConnector; use open_ssl::ssl::SslConnector;
use tokio_net::tcp::TcpStream; use tokio::net::tcp::TcpStream;
use tokio_openssl::{HandshakeError, SslStream}; use tokio_openssl::{HandshakeError, SslStream};
use trust_dns_resolver::AsyncResolver; use trust_dns_resolver::AsyncResolver;

View File

@ -14,7 +14,7 @@ use actix_connect::Connect;
#[actix_rt::test] #[actix_rt::test]
async fn test_string() { async fn test_string() {
let srv = TestServer::with(|| { let srv = TestServer::with(|| {
service_fn(|io: Io<tokio_net::tcp::TcpStream>| { service_fn(|io: Io<tokio::net::tcp::TcpStream>| {
async { async {
let mut framed = Framed::new(io.into_parts().0, BytesCodec); let mut framed = Framed::new(io.into_parts().0, BytesCodec);
framed.send(Bytes::from_static(b"test")).await?; framed.send(Bytes::from_static(b"test")).await?;
@ -33,7 +33,7 @@ async fn test_string() {
#[actix_rt::test] #[actix_rt::test]
async fn test_rustls_string() { async fn test_rustls_string() {
let srv = TestServer::with(|| { let srv = TestServer::with(|| {
service_fn(|io: Io<tokio_net::tcp::TcpStream>| { service_fn(|io: Io<tokio::net::tcp::TcpStream>| {
async { async {
let mut framed = Framed::new(io.into_parts().0, BytesCodec); let mut framed = Framed::new(io.into_parts().0, BytesCodec);
framed.send(Bytes::from_static(b"test")).await?; framed.send(Bytes::from_static(b"test")).await?;
@ -51,7 +51,7 @@ async fn test_rustls_string() {
#[actix_rt::test] #[actix_rt::test]
async fn test_static_str() { async fn test_static_str() {
let srv = TestServer::with(|| { let srv = TestServer::with(|| {
service_fn(|io: Io<tokio_net::tcp::TcpStream>| { service_fn(|io: Io<tokio::net::tcp::TcpStream>| {
async { async {
let mut framed = Framed::new(io.into_parts().0, BytesCodec); let mut framed = Framed::new(io.into_parts().0, BytesCodec);
framed.send(Bytes::from_static(b"test")).await?; framed.send(Bytes::from_static(b"test")).await?;
@ -75,7 +75,7 @@ async fn test_static_str() {
#[actix_rt::test] #[actix_rt::test]
async fn test_new_service() { async fn test_new_service() {
let srv = TestServer::with(|| { let srv = TestServer::with(|| {
service_fn(|io: Io<tokio_net::tcp::TcpStream>| { service_fn(|io: Io<tokio::net::tcp::TcpStream>| {
async { async {
let mut framed = Framed::new(io.into_parts().0, BytesCodec); let mut framed = Framed::new(io.into_parts().0, BytesCodec);
framed.send(Bytes::from_static(b"test")).await?; framed.send(Bytes::from_static(b"test")).await?;
@ -100,7 +100,7 @@ async fn test_uri() {
use http::HttpTryFrom; use http::HttpTryFrom;
let srv = TestServer::with(|| { let srv = TestServer::with(|| {
service_fn(|io: Io<tokio_net::tcp::TcpStream>| { service_fn(|io: Io<tokio::net::tcp::TcpStream>| {
async { async {
let mut framed = Framed::new(io.into_parts().0, BytesCodec); let mut framed = Framed::new(io.into_parts().0, BytesCodec);
framed.send(Bytes::from_static(b"test")).await?; framed.send(Bytes::from_static(b"test")).await?;
@ -121,7 +121,7 @@ async fn test_rustls_uri() {
use http::HttpTryFrom; use http::HttpTryFrom;
let srv = TestServer::with(|| { let srv = TestServer::with(|| {
service_fn(|io: Io<tokio_net::tcp::TcpStream>| { service_fn(|io: Io<tokio::net::tcp::TcpStream>| {
async { async {
let mut framed = Framed::new(io.into_parts().0, BytesCodec); let mut framed = Framed::new(io.into_parts().0, BytesCodec);
framed.send(Bytes::from_static(b"test")).await?; framed.send(Bytes::from_static(b"test")).await?;

View File

@ -32,4 +32,4 @@ log = "0.4"
actix-connect = "1.0.0-alpha.1" actix-connect = "1.0.0-alpha.1"
actix-testing = "0.3.0-alpha.1" actix-testing = "0.3.0-alpha.1"
actix-server-config = "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"] }

View File

@ -8,7 +8,7 @@ use actix_server_config::Io;
use actix_service::{apply_fn_factory, service_fn, Service}; use actix_service::{apply_fn_factory, service_fn, Service};
use actix_testing::TestServer; use actix_testing::TestServer;
use futures::future::ok; use futures::future::ok;
use tokio_net::tcp::TcpStream; use tokio::net::tcp::TcpStream;
use actix_ioframe::{Builder, Connect}; use actix_ioframe::{Builder, Connect};

View File

@ -22,9 +22,6 @@ actix-macros = "0.1.0-alpha.1"
actix-threadpool = "0.2" actix-threadpool = "0.2"
futures = "0.3.1" futures = "0.3.1"
tokio = "=0.2.0-alpha.6" tokio = { version = "0.2", features = ["net", "time"] }
tokio-executor = "=0.2.0-alpha.6"
tokio-net = "=0.2.0-alpha.6"
tokio-timer = "=0.3.0-alpha.6"
copyless = "0.1.4" copyless = "0.1.4"

View File

@ -7,8 +7,8 @@ use futures::future::{lazy, Future, FutureExt};
use tokio::runtime::current_thread::Handle; use tokio::runtime::current_thread::Handle;
use tokio_executor::current_thread::CurrentThread; use tokio_executor::current_thread::CurrentThread;
use tokio_net::driver::Reactor; use tokio::net::driver::Reactor;
use tokio_timer::{clock::Clock, timer::Timer}; use tokio::time::{clock::Clock, timer::Timer};
use crate::arbiter::{Arbiter, SystemArbiter}; use crate::arbiter::{Arbiter, SystemArbiter};
use crate::runtime::Runtime; use crate::runtime::Runtime;

View File

@ -3,7 +3,7 @@ use std::{fmt, io};
use futures::Future; use futures::Future;
use tokio_executor::current_thread::{self, CurrentThread}; 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::{ use tokio_timer::{
clock::Clock, clock::Clock,
timer::{self, Timer}, timer::{self, Timer},
@ -152,7 +152,7 @@ impl Runtime {
// automatically inside its `block_on` and `run` methods // automatically inside its `block_on` and `run` methods
tokio_executor::with_default(&mut current_thread::TaskExecutor::current(), || { tokio_executor::with_default(&mut current_thread::TaskExecutor::current(), || {
tokio_timer::clock::with_default(clock, || { 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); let _timer_guard = tokio_timer::set_default(timer_handle);
f(executor) f(executor)
}) })

View File

@ -21,7 +21,7 @@ pub(crate) enum Signal {
pub(crate) struct Signals { pub(crate) struct Signals {
srv: Server, srv: Server,
#[cfg(not(unix))] #[cfg(not(unix))]
stream: tokio_net::signal::CtrlC, stream: tokio::net::signal::CtrlC,
#[cfg(unix)] #[cfg(unix)]
streams: Vec<(Signal, tokio::signal::unix::Signal)>, streams: Vec<(Signal, tokio::signal::unix::Signal)>,
} }
@ -31,7 +31,7 @@ impl Signals {
actix_rt::spawn({ actix_rt::spawn({
#[cfg(not(unix))] #[cfg(not(unix))]
{ {
let stream = tokio_net::signal::ctrl_c()?; let stream = tokio::net::signal::ctrl_c()?;
Signals { srv, stream } Signals { srv, stream }
} }

View File

@ -26,4 +26,4 @@ actix-service = "1.0.0-alpha.1"
log = "0.4" log = "0.4"
net2 = "0.2" net2 = "0.2"
futures = "0.3.1" futures = "0.3.1"
tokio-net = { version = "0.2.0-alpha.6" } tokio = { version = "0.2", features = ["net"] }

View File

@ -7,8 +7,8 @@ use actix_server::{Server, ServerBuilder, ServiceFactory};
pub use actix_server_config::{Io, ServerConfig}; pub use actix_server_config::{Io, ServerConfig};
use net2::TcpBuilder; use net2::TcpBuilder;
use tokio_net::driver::Handle; use tokio::net::driver::Handle;
use tokio_net::tcp::TcpStream; use tokio::net::tcp::TcpStream;
#[cfg(not(test))] // Work around for rust-lang/rust#62127 #[cfg(not(test))] // Work around for rust-lang/rust#62127
pub use actix_macros::test; pub use actix_macros::test;