mirror of
https://github.com/fafhrd91/actix-net
synced 2024-11-30 16:34:36 +01:00
assert workers greater than zero (#167)
This commit is contained in:
parent
578a560853
commit
fecdfcd8d4
@ -1,5 +1,11 @@
|
|||||||
# Changes
|
# Changes
|
||||||
|
|
||||||
|
## Unreleased
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
* workers must be greater than 0
|
||||||
|
|
||||||
## [1.0.3] - 2020-05-19
|
## [1.0.3] - 2020-05-19
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
|
@ -72,8 +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.
|
/// 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");
|
||||||
self.threads = num;
|
self.threads = num;
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user