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
-4
@@ -10,7 +10,7 @@ use std::thread;
|
||||
use futures::Future;
|
||||
use futures::stream::Stream;
|
||||
use tokio::net::TcpListener;
|
||||
use tokio::reactor::Reactor;
|
||||
use tokio::reactor::Handle;
|
||||
use tokio_io::AsyncRead;
|
||||
use tokio_io::io::copy;
|
||||
|
||||
@@ -25,8 +25,8 @@ macro_rules! t {
|
||||
fn echo_server() {
|
||||
drop(env_logger::init());
|
||||
|
||||
let mut l = t!(Reactor::new());
|
||||
let srv = t!(TcpListener::bind(&t!("127.0.0.1:0".parse()), &l.handle()));
|
||||
let handle = Handle::default();
|
||||
let srv = t!(TcpListener::bind(&t!("127.0.0.1:0".parse()), &handle));
|
||||
let addr = t!(srv.local_addr());
|
||||
|
||||
let msg = "foo bar baz";
|
||||
@@ -46,7 +46,7 @@ fn echo_server() {
|
||||
let halves = client.map(|s| s.0.split());
|
||||
let copied = halves.and_then(|(a, b)| copy(a, b));
|
||||
|
||||
let (amt, _, _) = t!(l.run(copied));
|
||||
let (amt, _, _) = t!(copied.wait());
|
||||
t.join().unwrap();
|
||||
|
||||
assert_eq!(amt, msg.len() as u64 * 1024);
|
||||
|
||||
Reference in New Issue
Block a user