1
0
Fork 0
mirror of https://github.com/actix/actix-web.git synced 2024-11-20 08:31:09 +00: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
### Deleted
* Delete HttpServer::run(), it is not useful witht async/await
## [2.0.0-alpha.3] - 2019-12-07
### Changed

View file

@ -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(