Threadpool blocking (#317)

This patch adds a `blocking` to `tokio-threadpool`. This function serves
as a way to annotate sections of code that will perform blocking
operations. This informs the thread pool that an additional thread needs
to be spawned to replace the current thread, which will no longer be
able to process the work queue.
This commit is contained in:
Carl Lerche
2018-04-15 12:29:22 -07:00
committed by GitHub
parent 372400ed34
commit 61d635e8ad
26 changed files with 2794 additions and 286 deletions
+5 -1
View File
@@ -4,8 +4,10 @@
#![deny(warnings, missing_docs, missing_debug_implementations)]
extern crate tokio_executor;
extern crate futures;
extern crate crossbeam_deque as deque;
#[macro_use]
extern crate futures;
extern crate num_cpus;
extern crate rand;
@@ -17,6 +19,7 @@ extern crate futures2;
pub mod park;
mod blocking;
mod builder;
mod callback;
mod config;
@@ -31,6 +34,7 @@ mod task;
mod thread_pool;
mod worker;
pub use blocking::{blocking, BlockingError};
pub use builder::Builder;
pub use sender::Sender;
pub use shutdown::Shutdown;