1
0
mirror of https://github.com/fafhrd91/actix-net synced 2024-11-30 16:34:36 +01: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

@ -1,11 +1,19 @@
# Changes # Changes
## [0.2.3] - 2019-06-22
### Added
* Allow to start System using exsiting CurrentThread Handle #22
## [0.2.2] - 2019-03-28 ## [0.2.2] - 2019-03-28
### Changed ### Changed
* Moved `blocking` module to `actix-threadpool` crate * Moved `blocking` module to `actix-threadpool` crate
## [0.2.1] - 2019-03-11 ## [0.2.1] - 2019-03-11
### Added ### Added
@ -16,12 +24,14 @@
* Arbiter::exec - execute fn on the arbiter's thread and wait result * Arbiter::exec - execute fn on the arbiter's thread and wait result
## [0.2.0] - 2019-03-06 ## [0.2.0] - 2019-03-06
* `run` method returns `io::Result<()>` * `run` method returns `io::Result<()>`
* Removed `Handle` * Removed `Handle`
## [0.1.0] - 2018-12-09 ## [0.1.0] - 2018-12-09
* Initial release * Initial release

View File

@ -1,6 +1,6 @@
[package] [package]
name = "actix-rt" name = "actix-rt"
version = "0.2.2" version = "0.2.3"
authors = ["Nikolay Kim <fafhrd91@gmail.com>"] authors = ["Nikolay Kim <fafhrd91@gmail.com>"]
description = "Actix runtime" description = "Actix runtime"
keywords = ["network", "framework", "async", "futures"] keywords = ["network", "framework", "async", "futures"]
@ -18,7 +18,7 @@ name = "actix_rt"
path = "src/lib.rs" path = "src/lib.rs"
[dependencies] [dependencies]
actix-threadpool = "0.1.0" actix-threadpool = "0.1.1"
futures = "0.1.25" futures = "0.1.25"
tokio-current-thread = "0.1" tokio-current-thread = "0.1"
tokio-executor = "0.1.5" tokio-executor = "0.1.5"

View File

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

View File

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