From 939c761acbb92f8d690c47d0bdf14ec9f4e3a290 Mon Sep 17 00:00:00 2001 From: fakeshadow <24548779@qq.com> Date: Mon, 23 Nov 2020 20:54:28 +0800 Subject: [PATCH] add blocking feature flag for actix-rt --- actix-rt/Cargo.toml | 10 +++++++--- actix-rt/src/lib.rs | 1 + 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/actix-rt/Cargo.toml b/actix-rt/Cargo.toml index b7d272cd..7826b7d5 100644 --- a/actix-rt/Cargo.toml +++ b/actix-rt/Cargo.toml @@ -15,12 +15,16 @@ edition = "2018" name = "actix_rt" path = "src/lib.rs" +[features] +default = ["blocking"] +blocking = ["actix-threadpool"] + [dependencies] actix-macros = "0.1.0" -actix-threadpool = "0.3" -futures-channel = { version = "0.3.4", default-features = false } -futures-util = { version = "0.3.4", default-features = false, features = ["alloc"] } +actix-threadpool = { version = "0.3", optional = true } copyless = "0.1.4" +futures-channel = "0.3.4" +futures-util = { version = "0.3.4", default-features = false, features = ["alloc"] } smallvec = "1" tokio = { version = "0.2.6", default-features = false, features = ["rt-core", "rt-util", "io-driver", "tcp", "uds", "udp", "time", "signal", "stream"] } diff --git a/actix-rt/src/lib.rs b/actix-rt/src/lib.rs index aef78f12..bf9094c9 100644 --- a/actix-rt/src/lib.rs +++ b/actix-rt/src/lib.rs @@ -16,6 +16,7 @@ pub use self::runtime::Runtime; pub use self::system::System; #[doc(hidden)] +#[cfg(feature = "blocking")] pub use actix_threadpool as blocking; /// Spawns a future on the current arbiter.