diff --git a/CHANGES.md b/CHANGES.md index cd7e0f7d..e7045282 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 57adec52..03abad16 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(