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