mirror of https://github.com/fafhrd91/actix-net
rename ServerBuilder::maxconn
This commit is contained in:
parent
ba8d35feb0
commit
7e5daf5cd2
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
## Unreleased - 2021-xx-xx
|
## Unreleased - 2021-xx-xx
|
||||||
* Rename `Server` to `ServerHandle`. [#407]
|
* Rename `Server` to `ServerHandle`. [#407]
|
||||||
|
* Rename `ServerBuilder::{maxconn => max_concurrent_connections}`. [#407]
|
||||||
* Minimum supported Rust version (MSRV) is now 1.52.
|
* Minimum supported Rust version (MSRV) is now 1.52.
|
||||||
|
|
||||||
[#407]: https://github.com/actix/actix-net/pull/407
|
[#407]: https://github.com/actix/actix-net/pull/407
|
||||||
|
|
|
@ -118,11 +118,20 @@ impl ServerBuilder {
|
||||||
/// reached for each worker.
|
/// reached for 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 maxconn(mut self, num: usize) -> Self {
|
pub fn max_concurrent_connections(mut self, num: usize) -> Self {
|
||||||
self.worker_config.max_concurrent_connections(num);
|
self.worker_config
|
||||||
|
|
||||||
|
|
||||||
|
.max_concurrent_connections(num);
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[doc(hidden)]
|
||||||
|
#[deprecated(since = "2.0.0", note = "Renamed to `max_concurrent_connections`.")]
|
||||||
|
pub fn maxconn(self, num: usize) -> Self {
|
||||||
|
self.max_concurrent_connections(num)
|
||||||
|
}
|
||||||
|
|
||||||
/// Stop Actix system.
|
/// Stop Actix system.
|
||||||
pub fn system_exit(mut self) -> Self {
|
pub fn system_exit(mut self) -> Self {
|
||||||
self.exit = true;
|
self.exit = true;
|
||||||
|
|
|
@ -170,7 +170,7 @@ async fn test_max_concurrent_connections() {
|
||||||
// Set a relative higher backlog.
|
// Set a relative higher backlog.
|
||||||
.backlog(12)
|
.backlog(12)
|
||||||
// max connection for a worker is 3.
|
// max connection for a worker is 3.
|
||||||
.maxconn(max_conn)
|
.max_concurrent_connections(max_conn)
|
||||||
.workers(1)
|
.workers(1)
|
||||||
.disable_signals()
|
.disable_signals()
|
||||||
.bind("test", addr, move || {
|
.bind("test", addr, move || {
|
||||||
|
|
Loading…
Reference in New Issue