Skip to content

Commit

Permalink
rename ServerBuilder::maxconn
Browse files Browse the repository at this point in the history
  • Loading branch information
robjtede committed Nov 1, 2021
1 parent ba8d35f commit e46883f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions actix-server/CHANGES.md
Expand Up @@ -2,6 +2,7 @@

## Unreleased - 2021-xx-xx
* Rename `Server` to `ServerHandle`. [#407]
* Rename `ServerBuilder::{maxconn => max_concurrent_connections}`. [#407]
* Minimum supported Rust version (MSRV) is now 1.52.

[#407]: https://github.com/actix/actix-net/pull/407
Expand Down
8 changes: 7 additions & 1 deletion actix-server/src/builder.rs
Expand Up @@ -118,11 +118,17 @@ impl ServerBuilder {
/// reached for each 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
}

#[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.
pub fn system_exit(mut self) -> Self {
self.exit = true;
Expand Down
2 changes: 1 addition & 1 deletion actix-server/tests/test_server.rs
Expand Up @@ -170,7 +170,7 @@ async fn test_max_concurrent_connections() {
// Set a relative higher backlog.
.backlog(12)
// max connection for a worker is 3.
.maxconn(max_conn)
.max_concurrent_connections(max_conn)
.workers(1)
.disable_signals()
.bind("test", addr, move || {
Expand Down

0 comments on commit e46883f

Please sign in to comment.