mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-08-30 00:00:16 +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
+5
-7
@@ -43,18 +43,16 @@
|
||||
//! extern crate tokio;
|
||||
//! extern crate tokio_io;
|
||||
//!
|
||||
//! use futures::{Future, Stream};
|
||||
//! use futures::prelude::*;
|
||||
//! use futures::future::Executor;
|
||||
//! use futures_cpupool::CpuPool;
|
||||
//! use tokio_io::AsyncRead;
|
||||
//! use tokio_io::io::copy;
|
||||
//! use tokio::net::TcpListener;
|
||||
//! use tokio::reactor::Reactor;
|
||||
//! use tokio::reactor::Handle;
|
||||
//!
|
||||
//! fn main() {
|
||||
//! // Create the event loop that will drive this server.
|
||||
//! let mut core = Reactor::new().unwrap();
|
||||
//! let handle = core.handle();
|
||||
//! let handle = Handle::default();
|
||||
//!
|
||||
//! let pool = CpuPool::new_num_cpus();
|
||||
//!
|
||||
@@ -86,8 +84,8 @@
|
||||
//! Ok(())
|
||||
//! });
|
||||
//!
|
||||
//! // Spin up the server on the event loop.
|
||||
//! core.run(server).unwrap();
|
||||
//! // Spin up the server on this thread
|
||||
//! server.wait().unwrap();
|
||||
//! }
|
||||
//! ```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user