mirror of https://github.com/fafhrd91/actix-net
Update tokio to 0.2
This commit is contained in:
parent
4d67682cff
commit
b98b897c8e
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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};
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ use actix_connect::Connect;
|
|||
#[actix_rt::test]
|
||||
async fn test_string() {
|
||||
let srv = TestServer::with(|| {
|
||||
service_fn(|io: Io<tokio_net::tcp::TcpStream>| {
|
||||
service_fn(|io: Io<tokio::net::tcp::TcpStream>| {
|
||||
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<tokio_net::tcp::TcpStream>| {
|
||||
service_fn(|io: Io<tokio::net::tcp::TcpStream>| {
|
||||
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<tokio_net::tcp::TcpStream>| {
|
||||
service_fn(|io: Io<tokio::net::tcp::TcpStream>| {
|
||||
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<tokio_net::tcp::TcpStream>| {
|
||||
service_fn(|io: Io<tokio::net::tcp::TcpStream>| {
|
||||
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<tokio_net::tcp::TcpStream>| {
|
||||
service_fn(|io: Io<tokio::net::tcp::TcpStream>| {
|
||||
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<tokio_net::tcp::TcpStream>| {
|
||||
service_fn(|io: Io<tokio::net::tcp::TcpStream>| {
|
||||
async {
|
||||
let mut framed = Framed::new(io.into_parts().0, BytesCodec);
|
||||
framed.send(Bytes::from_static(b"test")).await?;
|
||||
|
|
|
@ -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"] }
|
||||
|
|
|
@ -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};
|
||||
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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)
|
||||
})
|
||||
|
|
|
@ -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 }
|
||||
}
|
||||
|
||||
|
|
|
@ -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"] }
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue