mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-08-27 00:00:12 +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
@@ -18,7 +18,7 @@ use futures::{Future, Stream, Sink};
|
||||
use futures::future::Executor;
|
||||
use futures_cpupool::CpuPool;
|
||||
use tokio::net::{UdpSocket, UdpCodec};
|
||||
use tokio::reactor::Reactor;
|
||||
use tokio::reactor::Handle;
|
||||
|
||||
pub struct LineCodec;
|
||||
|
||||
@@ -39,8 +39,7 @@ impl UdpCodec for LineCodec {
|
||||
fn main() {
|
||||
drop(env_logger::init());
|
||||
|
||||
let mut core = Reactor::new().unwrap();
|
||||
let handle = core.handle();
|
||||
let handle = Handle::default();
|
||||
|
||||
let pool = CpuPool::new(1);
|
||||
|
||||
@@ -79,5 +78,5 @@ fn main() {
|
||||
|
||||
// Spawn the sender of pongs and then wait for our pinger to finish.
|
||||
pool.execute(b.then(|_| Ok(()))).unwrap();
|
||||
drop(core.run(a));
|
||||
drop(a.wait());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user