Apply suggestions from code review

Co-authored-by: Rob Ede <robjtede@icloud.com>
This commit is contained in:
fakeshadow 2021-02-04 03:34:50 -08:00 committed by GitHub
parent 714e57d0b5
commit 02e677364f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 6 deletions

View File

@ -78,20 +78,19 @@ impl ServerBuilder {
self self
} }
/// Set number of max blocking threads for running blocking task on thread pool. /// Set max number of threads for each worker's blocking task thread pool.
/// ///
/// * This thread pool is per worker and `NOT` shared across workers. /// One thread pool is set up **per worker**; not shared across workers.
/// ///
/// # Examples: /// # Examples:
/// ```rust /// ```
/// # use actix_server::ServerBuilder; /// # use actix_server::ServerBuilder;
/// let builder = ServerBuilder::new() /// let builder = ServerBuilder::new()
/// .workers(4) // server has 4 worker thread. /// .workers(4) // server has 4 worker thread.
/// .worker_max_blocking_threads(4); // every worker has 4 max blocking threads. /// .worker_max_blocking_threads(4); // every worker has 4 max blocking threads.
/// ``` /// ```
/// ///
/// See [tokio::runtime::Builder::max_blocking_threads](tokio::runtime::Builder::max_blocking_threads) /// See [tokio::runtime::Builder::max_blocking_threads] for behavior reference.
/// for behavior reference.
pub fn worker_max_blocking_threads(mut self, num: usize) -> Self { pub fn worker_max_blocking_threads(mut self, num: usize) -> Self {
self.worker_config.max_blocking_threads(num); self.worker_config.max_blocking_threads(num);
self self

View File

@ -159,7 +159,7 @@ enum WorkerServiceStatus {
Stopped, Stopped,
} }
// config for worker behavior passed from server builder. /// Config for worker behavior passed down from server builder.
#[derive(Copy, Clone)] #[derive(Copy, Clone)]
pub(crate) struct ServerWorkerConfig { pub(crate) struct ServerWorkerConfig {
shutdown_timeout: Duration, shutdown_timeout: Duration,