mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-08-29 00:00:11 +02:00
Remove the Reactor::run method (#58)
This commit removes the `Reactor::run` method which has previously been used to execute futures and turn the reactor at the same time. The tests/examples made heavy usage of this method but they have now all temporarily moved to `wait()` until the futures dependency is upgraded. In the meantime this'll allow us to further trim down the `Reactor` APIs to their final state.
This commit is contained in:
committed by
Carl Lerche
parent
32f2750c2d
commit
a577bfc033
+4
-5
@@ -33,7 +33,7 @@ use futures::future::Executor;
|
||||
use futures::stream::{self, Stream};
|
||||
use futures_cpupool::CpuPool;
|
||||
use tokio::net::TcpListener;
|
||||
use tokio::reactor::Reactor;
|
||||
use tokio::reactor::Handle;
|
||||
use tokio_io::io;
|
||||
use tokio_io::AsyncRead;
|
||||
|
||||
@@ -41,9 +41,8 @@ fn main() {
|
||||
let addr = env::args().nth(1).unwrap_or("127.0.0.1:8080".to_string());
|
||||
let addr = addr.parse().unwrap();
|
||||
|
||||
// Create the event loop and TCP listener we'll accept connections on.
|
||||
let mut core = Reactor::new().unwrap();
|
||||
let handle = core.handle();
|
||||
// Create the TCP listener we'll accept connections on.
|
||||
let handle = Handle::default();
|
||||
let socket = TcpListener::bind(&addr, &handle).unwrap();
|
||||
println!("Listening on: {}", addr);
|
||||
|
||||
@@ -135,5 +134,5 @@ fn main() {
|
||||
});
|
||||
|
||||
// execute server
|
||||
core.run(srv).unwrap();
|
||||
srv.wait().unwrap();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user