mirror of
https://github.com/fafhrd91/actix-net
synced 2025-02-17 14:43:31 +01:00
move threadpool to separate crate
This commit is contained in:
parent
16856c7d3f
commit
7c5afc09a6
@ -22,6 +22,7 @@ members = [
|
|||||||
"actix-server",
|
"actix-server",
|
||||||
"actix-server-config",
|
"actix-server-config",
|
||||||
"actix-test-server",
|
"actix-test-server",
|
||||||
|
"actix-threadpool",
|
||||||
"actix-utils",
|
"actix-utils",
|
||||||
"router",
|
"router",
|
||||||
]
|
]
|
||||||
|
@ -1,5 +1,11 @@
|
|||||||
# Changes
|
# Changes
|
||||||
|
|
||||||
|
## [0.2.2] - 2019-03-28
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
* Moved `blocking` module to `actix-threadpool` crate
|
||||||
|
|
||||||
## [0.2.1] - 2019-03-11
|
## [0.2.1] - 2019-03-11
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "actix-rt"
|
name = "actix-rt"
|
||||||
version = "0.2.1"
|
version = "0.2.2"
|
||||||
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"]
|
||||||
@ -11,21 +11,15 @@ categories = ["network-programming", "asynchronous"]
|
|||||||
license = "MIT/Apache-2.0"
|
license = "MIT/Apache-2.0"
|
||||||
exclude = [".gitignore", ".travis.yml", ".cargo/config", "appveyor.yml"]
|
exclude = [".gitignore", ".travis.yml", ".cargo/config", "appveyor.yml"]
|
||||||
edition = "2018"
|
edition = "2018"
|
||||||
workspace = "../"
|
workspace = ".."
|
||||||
|
|
||||||
[lib]
|
[lib]
|
||||||
name = "actix_rt"
|
name = "actix_rt"
|
||||||
path = "src/lib.rs"
|
path = "src/lib.rs"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
bytes = "0.4"
|
actix-threadpool = { path="../actix-threadpool" }
|
||||||
derive_more = "0.14"
|
|
||||||
futures = "0.1.25"
|
futures = "0.1.25"
|
||||||
parking_lot = "0.7"
|
|
||||||
lazy_static = "1.2"
|
|
||||||
log = "0.4"
|
|
||||||
num_cpus = "1.10"
|
|
||||||
threadpool = "1.7"
|
|
||||||
tokio-current-thread = "0.1"
|
tokio-current-thread = "0.1"
|
||||||
tokio-executor = "0.1.5"
|
tokio-executor = "0.1.5"
|
||||||
tokio-reactor = "0.1.7"
|
tokio-reactor = "0.1.7"
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
//! A runtime implementation that runs everything on the current thread.
|
//! A runtime implementation that runs everything on the current thread.
|
||||||
|
|
||||||
mod arbiter;
|
mod arbiter;
|
||||||
pub mod blocking;
|
|
||||||
mod builder;
|
mod builder;
|
||||||
mod runtime;
|
mod runtime;
|
||||||
mod system;
|
mod system;
|
||||||
@ -11,6 +10,9 @@ pub use self::builder::{Builder, SystemRunner};
|
|||||||
pub use self::runtime::Runtime;
|
pub use self::runtime::Runtime;
|
||||||
pub use self::system::System;
|
pub use self::system::System;
|
||||||
|
|
||||||
|
#[doc(hidden)]
|
||||||
|
pub use actix_threadpool as blocking;
|
||||||
|
|
||||||
/// Spawns a future on the current arbiter.
|
/// Spawns a future on the current arbiter.
|
||||||
///
|
///
|
||||||
/// # Panics
|
/// # Panics
|
||||||
|
5
actix-threadpool/CHANGES.md
Normal file
5
actix-threadpool/CHANGES.md
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
# Changes
|
||||||
|
|
||||||
|
## [0.1.0] - 2019-03-28
|
||||||
|
|
||||||
|
* Move threadpool to separate crate
|
27
actix-threadpool/Cargo.toml
Normal file
27
actix-threadpool/Cargo.toml
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
[package]
|
||||||
|
name = "actix-threadpool"
|
||||||
|
version = "0.1.0"
|
||||||
|
authors = ["Nikolay Kim <fafhrd91@gmail.com>"]
|
||||||
|
description = "Actix thread pool for sync code"
|
||||||
|
keywords = ["actix", "network", "framework", "async", "futures"]
|
||||||
|
homepage = "https://actix.rs"
|
||||||
|
repository = "https://github.com/actix/actix-net.git"
|
||||||
|
documentation = "https://docs.rs/actix-threadpool/"
|
||||||
|
categories = ["network-programming", "asynchronous"]
|
||||||
|
license = "MIT/Apache-2.0"
|
||||||
|
exclude = [".gitignore", ".travis.yml", ".cargo/config", "appveyor.yml"]
|
||||||
|
edition = "2018"
|
||||||
|
workspace = ".."
|
||||||
|
|
||||||
|
[lib]
|
||||||
|
name = "actix_threadpool"
|
||||||
|
path = "src/lib.rs"
|
||||||
|
|
||||||
|
[dependencies]
|
||||||
|
derive_more = "0.14"
|
||||||
|
futures = "0.1.25"
|
||||||
|
parking_lot = "0.7"
|
||||||
|
lazy_static = "1.2"
|
||||||
|
log = "0.4"
|
||||||
|
num_cpus = "1.10"
|
||||||
|
threadpool = "1.7"
|
@ -9,7 +9,7 @@ use parking_lot::Mutex;
|
|||||||
use threadpool::ThreadPool;
|
use threadpool::ThreadPool;
|
||||||
|
|
||||||
/// Env variable for default cpu pool size
|
/// Env variable for default cpu pool size
|
||||||
const ENV_CPU_POOL_VAR: &str = "ACTIX_CPU_POOL";
|
const ENV_CPU_POOL_VAR: &str = "ACTIX_THREADPOOL";
|
||||||
|
|
||||||
lazy_static::lazy_static! {
|
lazy_static::lazy_static! {
|
||||||
pub(crate) static ref DEFAULT_POOL: Mutex<ThreadPool> = {
|
pub(crate) static ref DEFAULT_POOL: Mutex<ThreadPool> = {
|
||||||
@ -18,7 +18,7 @@ lazy_static::lazy_static! {
|
|||||||
if let Ok(val) = val.parse() {
|
if let Ok(val) = val.parse() {
|
||||||
val
|
val
|
||||||
} else {
|
} else {
|
||||||
log::error!("Can not parse ACTIX_CPU_POOL value");
|
log::error!("Can not parse ACTIX_THREADPOOL value");
|
||||||
num_cpus::get() * 5
|
num_cpus::get() * 5
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user