1
0
mirror of https://github.com/fafhrd91/actix-net synced 2025-06-27 06:09:02 +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

@ -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};