doc update

This commit is contained in:
Rob Ede 2021-11-01 23:14:18 +00:00
parent 7e5daf5cd2
commit dd13ebf0e5
1 changed files with 10 additions and 14 deletions

View File

@ -71,8 +71,8 @@ impl ServerBuilder {
/// Set number of workers to start. /// Set number of workers to start.
/// ///
/// By default server uses number of available logical cpu as workers /// By default server uses number of available logical CPU as workers count. Workers must be
/// count. Workers must be greater than 0. /// greater than 0.
pub fn workers(mut self, num: usize) -> Self { pub fn workers(mut self, num: usize) -> Self {
assert_ne!(num, 0, "workers must be greater than 0"); assert_ne!(num, 0, "workers must be greater than 0");
self.threads = num; self.threads = num;
@ -99,10 +99,9 @@ impl ServerBuilder {
/// Set the maximum number of pending connections. /// Set the maximum number of pending connections.
/// ///
/// This refers to the number of clients that can be waiting to be served. /// This refers to the number of clients that can be waiting to be served. Exceeding this number
/// Exceeding this number results in the client getting an error when /// results in the client getting an error when attempting to connect. It should only affect
/// attempting to connect. It should only affect servers under significant /// servers under significant load.
/// load.
/// ///
/// Generally set in the 64-2048 range. Default value is 2048. /// Generally set in the 64-2048 range. Default value is 2048.
/// ///
@ -114,15 +113,12 @@ impl ServerBuilder {
/// Sets the maximum per-worker number of concurrent connections. /// Sets the maximum per-worker number of concurrent connections.
/// ///
/// All socket listeners will stop accepting connections when this limit is /// All socket listeners will stop accepting connections when this limit is reached for
/// reached for each worker. /// each worker.
/// ///
/// By default max connections is set to a 25k per worker. /// By default max connections is set to a 25k per worker.
pub fn max_concurrent_connections(mut self, num: usize) -> Self { pub fn max_concurrent_connections(mut self, num: usize) -> Self {
self.worker_config self.worker_config.max_concurrent_connections(num);
.max_concurrent_connections(num);
self self
} }
@ -200,8 +196,8 @@ impl ServerBuilder {
} }
/// Add new unix domain service to the server. /// Add new unix domain service to the server.
/// Useful when running as a systemd service and ///
/// a socket FD can be acquired using the systemd crate. /// Useful when running as a systemd service and a socket FD is acquired externally.
#[cfg(unix)] #[cfg(unix)]
pub fn listen_uds<F, N: AsRef<str>>( pub fn listen_uds<F, N: AsRef<str>>(
mut self, mut self,