From 8df33f7a81fa98c77e0dc25dfd5288cff41557f7 Mon Sep 17 00:00:00 2001 From: Nikolay Kim Date: Sun, 8 Dec 2019 00:06:04 +0600 Subject: [PATCH] remove HttpServer::run() as it is not useful with async/await --- CHANGES.md | 4 ++++ src/server.rs | 26 -------------------------- 2 files changed, 4 insertions(+), 26 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index cd7e0f7dc..e70452821 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,9 @@ # Changes +### Deleted + +* Delete HttpServer::run(), it is not useful witht async/await + ## [2.0.0-alpha.3] - 2019-12-07 ### Changed diff --git a/src/server.rs b/src/server.rs index 57adec524..03abad160 100644 --- a/src/server.rs +++ b/src/server.rs @@ -531,32 +531,6 @@ where pub fn start(self) -> Server { self.builder.start() } - - /// Spawn new thread and start listening for incoming connections. - /// - /// This method spawns new thread and starts new actix system. Other than - /// that it is similar to `start()` method. This method blocks. - /// - /// This methods panics if no socket addresses get bound. - /// - /// ```rust - /// use std::io; - /// use actix_web::{web, App, HttpResponse, HttpServer}; - /// - /// fn main() -> io::Result<()> { - /// # std::thread::spawn(|| { - /// HttpServer::new(|| App::new().service(web::resource("/").to(|| HttpResponse::Ok()))) - /// .bind("127.0.0.1:0")? - /// .run() - /// # }); - /// # Ok(()) - /// } - /// ``` - pub fn run(self) -> io::Result<()> { - let sys = System::new("http-server"); - self.start(); - sys.run() - } } fn create_tcp_listener(