1
0
mirror of https://github.com/fafhrd91/actix-net synced 2025-06-28 05:10:36 +02:00

use actix deps instead of tokio

This commit is contained in:
Nikolay Kim
2019-11-26 08:26:22 +06:00
parent 5efac449b1
commit 52d03fa18c
23 changed files with 44 additions and 57 deletions

View File

@ -21,17 +21,15 @@ path = "src/lib.rs"
actix-service = "1.0.0-alpha.1"
actix-codec = "0.2.0-alpha.1"
actix-utils = "0.5.0-alpha.1"
actix-rt = "1.0.0-alpha.1"
bytes = "0.4"
either = "1.5.2"
futures = "0.3.1"
pin-project = "0.4.5"
tokio-executor = "=0.2.0-alpha.6"
log = "0.4"
[dev-dependencies]
actix-rt = "1.0.0-alpha.1"
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-timer = "=0.3.0-alpha.6"

View File

@ -279,22 +279,21 @@ where
};
let mut cell = inner.clone();
tokio_executor::current_thread::spawn(
srv.call(Item::new(state.clone(), sink.clone(), item))
.then(move |item| {
let item = match item {
Ok(Some(item)) => Ok(item),
Ok(None) => return ready(()),
Err(err) => Err(err),
};
unsafe {
let inner = cell.get_mut();
inner.buf.push_back(item);
inner.task.wake();
}
ready(())
}),
);
actix_rt::spawn(srv.call(Item::new(state.clone(), sink.clone(), item)).then(
move |item| {
let item = match item {
Ok(Some(item)) => Ok(item),
Ok(None) => return ready(()),
Err(err) => Err(err),
};
unsafe {
let inner = cell.get_mut();
inner.buf.push_back(item);
inner.task.wake();
}
ready(())
},
));
}
Poll::Pending => return false,
Poll::Ready(Err(err)) => {

View File

@ -3,12 +3,12 @@ use std::sync::Arc;
use std::time::Duration;
use actix_codec::BytesCodec;
use actix_rt::time::delay_for;
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_timer::delay_for;
use actix_ioframe::{Builder, Connect};