From 195246573e64d26f9b4e95eb626f838a85acd031 Mon Sep 17 00:00:00 2001 From: Nikolay Kim Date: Tue, 1 May 2018 13:15:35 -0700 Subject: [PATCH] rename threads to workers --- MIGRATION.md | 2 ++ src/server/srv.rs | 8 +++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/MIGRATION.md b/MIGRATION.md index 45c35d7de..24ccdb3a6 100644 --- a/MIGRATION.md +++ b/MIGRATION.md @@ -3,6 +3,8 @@ * `ws::Message::Close` now includes optional close reason. `ws::CloseCode::Status` and `ws::CloseCode::Empty` have been removed. +* `HttpServer::threads()` renamed to `HttpServer::workers()`. + * `HttpServer::start_ssl()` and `HttpServer::start_tls()` deprecated. Use `HttpServer::bind_ssl()` and `HttpServer::bind_tls()` instead. diff --git a/src/server/srv.rs b/src/server/srv.rs index 4ba263e7c..df3978411 100644 --- a/src/server/srv.rs +++ b/src/server/srv.rs @@ -109,11 +109,17 @@ where /// /// By default http server uses number of available logical cpu as threads /// count. - pub fn threads(mut self, num: usize) -> Self { + pub fn workers(mut self, num: usize) -> Self { self.threads = num; self } + #[doc(hidden)] + #[deprecated(since = "0.6.0", note = "please use `HttpServer::workers()` instead")] + pub fn threads(self, num: usize) -> Self { + self.workers(num) + } + /// Set the maximum number of pending connections. /// /// This refers to the number of clients that can be waiting to be served.