mirror of https://github.com/fafhrd91/actix-net
Apply suggestions from code review
Co-authored-by: Rob Ede <robjtede@icloud.com>
This commit is contained in:
parent
714e57d0b5
commit
02e677364f
|
@ -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
|
||||||
|
|
|
@ -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,
|
||||||
|
|
Loading…
Reference in New Issue