1
0
mirror of https://github.com/fafhrd91/actix-web synced 2024-11-27 17:52:56 +01:00

remove HttpServer::run() as it is not useful with async/await

This commit is contained in:
Nikolay Kim 2019-12-08 00:06:04 +06:00
parent 7ec5ca88a1
commit 8df33f7a81
2 changed files with 4 additions and 26 deletions

View File

@ -1,5 +1,9 @@
# Changes # Changes
### Deleted
* Delete HttpServer::run(), it is not useful witht async/await
## [2.0.0-alpha.3] - 2019-12-07 ## [2.0.0-alpha.3] - 2019-12-07
### Changed ### Changed

View File

@ -531,32 +531,6 @@ where
pub fn start(self) -> Server { pub fn start(self) -> Server {
self.builder.start() 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( fn create_tcp_listener(