From 9a19b08bcfd575eb5e32b35be27d2fd0e2549f7e Mon Sep 17 00:00:00 2001 From: Igor Aleksanov Date: Sat, 8 Aug 2020 09:28:27 +0300 Subject: [PATCH] Review fixes --- actix-rt/Cargo.toml | 1 - actix-rt/src/system.rs | 18 ++++++++++-------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/actix-rt/Cargo.toml b/actix-rt/Cargo.toml index d4a71f3f..b7d272cd 100644 --- a/actix-rt/Cargo.toml +++ b/actix-rt/Cargo.toml @@ -25,5 +25,4 @@ smallvec = "1" tokio = { version = "0.2.6", default-features = false, features = ["rt-core", "rt-util", "io-driver", "tcp", "uds", "udp", "time", "signal", "stream"] } [dev-dependencies] -futures = "0.3" tokio = { version = "0.2.6", features = ["full"] } diff --git a/actix-rt/src/system.rs b/actix-rt/src/system.rs index 937f94aa..f33854ba 100644 --- a/actix-rt/src/system.rs +++ b/actix-rt/src/system.rs @@ -63,17 +63,18 @@ impl System { /// /// Note: This method uses provided `LocalSet` to create a `System` future only. /// All the [`Arbiter`]s will be started in separate threads using their own tokio `Runtime`s. - /// It means that using this method currently it is impossible to make `actix-rt` work in the `Runtime` other - /// than the provided by `tokio` 0.2 (e.g. provided by `tokio_compat`). + /// It means that using this method currently it is impossible to make `actix-rt` work in the + /// alternative `tokio` `Runtime`s (e.g. provided by [`tokio_compat`]). /// /// [`Arbiter`]: struct.Arbiter.html + /// [`tokio_compat`]: https://crates.io/crates/tokio-compat /// /// # Examples /// /// ``` /// use tokio::{runtime::Runtime, task::LocalSet}; /// use actix_rt::System; - /// use futures::future::try_join_all; + /// use futures_util::future::try_join_all; /// /// async fn run_application() { /// let first_task = tokio::spawn(async { @@ -128,14 +129,15 @@ impl System { /// Note: This method uses provided `Runtime` to create a `System` future only. /// All the [`Arbiter`]s will be started in separate threads using their own tokio `Runtime`s. /// It means that using this method currently it is impossible to make `actix-rt` work in the - /// `Runtime` other than the provided by `tokio` 0.2 (e.g. provided by `tokio_compat`). + /// alternative `tokio` `Runtime`s (e.g. provided by `tokio_compat`). /// /// [`Arbiter`]: struct.Arbiter.html + /// [`tokio_compat`]: https://crates.io/crates/tokio-compat /// /// # Arguments /// - /// - `runtime`: A tokio Runtime to run the system in. /// - `name`: Name of the System + /// - `runtime`: A tokio Runtime to run the system in. /// - `rest_operations`: A future to be executed in the runtime along with the System. /// /// # Examples @@ -143,7 +145,7 @@ impl System { /// ``` /// use tokio::runtime::Runtime; /// use actix_rt::System; - /// use futures::future::try_join_all; + /// use futures_util::future::try_join_all; /// /// async fn run_application() { /// let first_task = tokio::spawn(async { @@ -172,11 +174,11 @@ impl System { /// .unwrap(); /// /// let rest_operations = run_application(); - /// System::attach_to_tokio(runtime, "actix-main-system", rest_operations); + /// System::attach_to_tokio("actix-main-system", runtime, rest_operations); /// ``` pub fn attach_to_tokio( - mut runtime: tokio::runtime::Runtime, name: impl Into, + mut runtime: tokio::runtime::Runtime, rest_operations: Fut, ) -> R where