1
0
mirror of https://github.com/fafhrd91/actix-net synced 2025-06-27 06:09:02 +02:00

prepare rt release

This commit is contained in:
Nikolay Kim
2019-06-22 09:02:17 +06:00
parent 1c04ad3238
commit 07708c5e9a
4 changed files with 17 additions and 7 deletions

View File

@ -159,11 +159,11 @@ pub(crate) struct AsyncSystemRunner {
impl AsyncSystemRunner {
/// This function will start event loop and returns a future that
/// resolves once the `System::stop()` function is called.
pub(crate) fn run_nonblocking(self) -> Box<Future<Item = (), Error = io::Error> + Send + 'static> {
pub(crate) fn run_nonblocking(self) -> impl Future<Item = (), Error = io::Error> + Send {
let AsyncSystemRunner { stop, .. } = self;
// run loop
Box::new(future::lazy(|| {
future::lazy(|| {
Arbiter::run_system();
stop.then(|res| match res {
Ok(code) => {
@ -182,7 +182,7 @@ impl AsyncSystemRunner {
Arbiter::stop_system();
result
})
}))
})
}
}

View File

@ -7,7 +7,7 @@ use futures::Future;
use tokio_current_thread::Handle;
use crate::arbiter::{Arbiter, SystemCommand};
use crate::builder::{AsyncSystemRunner, Builder, SystemRunner};
use crate::builder::{Builder, SystemRunner};
static SYSTEM_COUNT: AtomicUsize = AtomicUsize::new(0);
@ -64,7 +64,7 @@ impl System {
pub fn run_in_executor<T: Into<String>>(
name: T,
executor: Handle,
) -> Box<Future<Item = (), Error = io::Error> + Send + 'static> {
) -> impl Future<Item = (), Error = io::Error> + Send {
Self::builder()
.name(name)
.build_async(executor)