mirror of https://github.com/fafhrd91/actix-net
doc, changelog and fix
This commit is contained in:
parent
c937619a81
commit
e82f8d71fe
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
|
|
||||||
* workers(0) defaults to num_cpus::get()
|
* workers must be greater than 0
|
||||||
|
|
||||||
## [1.0.3] - 2020-05-19
|
## [1.0.3] - 2020-05-19
|
||||||
|
|
||||||
|
|
|
@ -72,9 +72,9 @@ 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. Explicitly setting 0 will also default.
|
/// count. Workers must be 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;
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue