From 07708c5e9aa05a10d762919d18463e6ccdfed18f Mon Sep 17 00:00:00 2001 From: Nikolay Kim Date: Sat, 22 Jun 2019 09:02:17 +0600 Subject: [PATCH] prepare rt release --- actix-rt/CHANGES.md | 10 ++++++++++ actix-rt/Cargo.toml | 4 ++-- actix-rt/src/builder.rs | 6 +++--- actix-rt/src/system.rs | 4 ++-- 4 files changed, 17 insertions(+), 7 deletions(-) diff --git a/actix-rt/CHANGES.md b/actix-rt/CHANGES.md index 47bb1dd0..3a893297 100644 --- a/actix-rt/CHANGES.md +++ b/actix-rt/CHANGES.md @@ -1,11 +1,19 @@ # Changes +## [0.2.3] - 2019-06-22 + +### Added + +* Allow to start System using exsiting CurrentThread Handle #22 + + ## [0.2.2] - 2019-03-28 ### Changed * Moved `blocking` module to `actix-threadpool` crate + ## [0.2.1] - 2019-03-11 ### Added @@ -16,12 +24,14 @@ * Arbiter::exec - execute fn on the arbiter's thread and wait result + ## [0.2.0] - 2019-03-06 * `run` method returns `io::Result<()>` * Removed `Handle` + ## [0.1.0] - 2018-12-09 * Initial release diff --git a/actix-rt/Cargo.toml b/actix-rt/Cargo.toml index 148e3243..d00346f3 100644 --- a/actix-rt/Cargo.toml +++ b/actix-rt/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "actix-rt" -version = "0.2.2" +version = "0.2.3" authors = ["Nikolay Kim "] description = "Actix runtime" keywords = ["network", "framework", "async", "futures"] @@ -18,7 +18,7 @@ name = "actix_rt" path = "src/lib.rs" [dependencies] -actix-threadpool = "0.1.0" +actix-threadpool = "0.1.1" futures = "0.1.25" tokio-current-thread = "0.1" tokio-executor = "0.1.5" diff --git a/actix-rt/src/builder.rs b/actix-rt/src/builder.rs index e9d2c8f1..71509f14 100644 --- a/actix-rt/src/builder.rs +++ b/actix-rt/src/builder.rs @@ -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 + Send + 'static> { + pub(crate) fn run_nonblocking(self) -> impl Future + 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 }) - })) + }) } } diff --git a/actix-rt/src/system.rs b/actix-rt/src/system.rs index 62179369..745de00f 100644 --- a/actix-rt/src/system.rs +++ b/actix-rt/src/system.rs @@ -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>( name: T, executor: Handle, - ) -> Box + Send + 'static> { + ) -> impl Future + Send { Self::builder() .name(name) .build_async(executor)