1
0
mirror of https://github.com/fafhrd91/actix-net synced 2025-06-26 19:47:43 +02:00

add test and main macros

This commit is contained in:
Nikolay Kim
2019-11-25 21:49:11 +06:00
parent 1fddd1e75b
commit 4ceac79f2c
25 changed files with 265 additions and 267 deletions

View File

@ -1,5 +1,19 @@
# Changes
## [1.0.0-alpha.2] - 2019-11-xx
Added
* Export `main` and `test` attribute macros
## [1.0.0-alpha.1] - 2019-11-22
### Changed
* Migrate to std::future and tokio 0.2
## [0.2.6] - 2019-11-14
### Fixed

View File

@ -18,13 +18,13 @@ name = "actix_rt"
path = "src/lib.rs"
[dependencies]
actix-macros = "0.1.0-alpha.1"
actix-threadpool = "0.2"
futures = "0.3.1"
# TODO: Replace this with dependency on tokio-runtime once it is ready
tokio = { version = "0.2.0-alpha.6" }
tokio-timer = "=0.3.0-alpha.6"
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"
copyless = "0.1.4"

View File

@ -9,7 +9,7 @@ use std::{fmt, thread};
use futures::channel::mpsc::{unbounded, UnboundedReceiver, UnboundedSender};
use futures::channel::oneshot::{channel, Canceled, Sender};
use futures::{future, Future, FutureExt, Stream};
use tokio::runtime::current_thread::spawn;
use tokio_executor::current_thread::spawn;
use crate::builder::Builder;
use crate::system::System;

View File

@ -3,17 +3,16 @@ use std::io;
use futures::channel::mpsc::unbounded;
use futures::channel::oneshot::{channel, Receiver};
use futures::future::{lazy, Future};
use futures::{future, FutureExt};
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 crate::arbiter::{Arbiter, SystemArbiter};
use crate::runtime::Runtime;
use crate::system::System;
use tokio_executor::current_thread::CurrentThread;
/// Builder struct for a actix runtime.
///
@ -163,7 +162,7 @@ impl AsyncSystemRunner {
let AsyncSystemRunner { stop, .. } = self;
// run loop
future::lazy(|_| {
lazy(|_| {
Arbiter::run_system();
async {
let res = match stop.await {

View File

@ -1,5 +1,7 @@
//! A runtime implementation that runs everything on the current thread.
pub use actix_macros::{main, test};
mod arbiter;
mod builder;
mod runtime;

View File

@ -1,9 +1,9 @@
use std::cell::RefCell;
use std::future::Future;
use std::io;
use std::sync::atomic::{AtomicUsize, Ordering};
use futures::channel::mpsc::UnboundedSender;
use futures::Future;
use tokio::runtime::current_thread::Handle;
use crate::arbiter::{Arbiter, SystemCommand};