From 108e1a2c1a66a6f0123704e42624b51e9536476f Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Tue, 5 Dec 2017 09:02:07 -0800 Subject: [PATCH] Blanket rename `Core` to `Reactor` This commit uses a script to rename `Core` to `Reactor` all at once, notably: find . -name '*.rs' | xargs sed -i 's/\bCore\b/Reactor/g' --- benches/latency.rs | 4 ++-- benches/tcp.rs | 10 +++++----- examples/chat.rs | 4 ++-- examples/compress.rs | 4 ++-- examples/connect.rs | 4 ++-- examples/echo-threads.rs | 4 ++-- examples/echo-udp.rs | 4 ++-- examples/echo.rs | 10 +++++----- examples/hello.rs | 4 ++-- examples/proxy.rs | 4 ++-- examples/sink.rs | 4 ++-- examples/tinydb.rs | 6 +++--- examples/tinyhttp.rs | 4 ++-- examples/udp-codec.rs | 4 ++-- src/lib.rs | 4 ++-- src/reactor/mod.rs | 20 ++++++++++---------- src/reactor/poll_evented.rs | 4 ++-- tests/buffered.rs | 4 ++-- tests/chain.rs | 4 ++-- tests/drop-core.rs | 6 +++--- tests/echo.rs | 4 ++-- tests/limit.rs | 4 ++-- tests/line-frames.rs | 4 ++-- tests/pipe-hup.rs | 4 ++-- tests/stream-buffered.rs | 4 ++-- tests/tcp.rs | 8 ++++---- tests/udp.rs | 8 ++++---- 27 files changed, 74 insertions(+), 74 deletions(-) diff --git a/benches/latency.rs b/benches/latency.rs index fd34c0e64b9..246d033bde9 100644 --- a/benches/latency.rs +++ b/benches/latency.rs @@ -16,7 +16,7 @@ use futures::sync::mpsc; use futures::{Future, Poll, Sink, Stream}; use test::Bencher; use tokio::net::UdpSocket; -use tokio::reactor::Core; +use tokio::reactor::Reactor; /// UDP echo server struct EchoServer { @@ -59,7 +59,7 @@ fn udp_echo_latency(b: &mut Bencher) { let (tx, rx) = oneshot::channel(); let child = thread::spawn(move || { - let mut l = Core::new().unwrap(); + let mut l = Reactor::new().unwrap(); let handle = l.handle(); let socket = tokio::net::UdpSocket::bind(&any_addr, &handle).unwrap(); diff --git a/benches/tcp.rs b/benches/tcp.rs index 245ed88104d..82dc6835998 100644 --- a/benches/tcp.rs +++ b/benches/tcp.rs @@ -10,7 +10,7 @@ pub extern crate test; mod prelude { pub use futures::*; - pub use tokio::reactor::Core; + pub use tokio::reactor::Reactor; pub use tokio::net::{TcpListener, TcpStream}; pub use tokio_io::io::read_to_end; @@ -29,7 +29,7 @@ mod connect_churn { #[bench] fn one_thread(b: &mut Bencher) { let addr = "127.0.0.1:0".parse().unwrap(); - let mut core = Core::new().unwrap(); + let mut core = Reactor::new().unwrap(); let handle = core.handle(); let listener = TcpListener::bind(&addr, &handle).unwrap(); let addr = listener.local_addr().unwrap(); @@ -63,7 +63,7 @@ mod connect_churn { // Spawn reactor thread thread::spawn(move || { // Create the core - let mut core = Core::new().unwrap(); + let mut core = Reactor::new().unwrap(); // Reactor handles let handle = core.handle(); @@ -209,7 +209,7 @@ mod transfer { fn one_thread(b: &mut Bencher, read_size: usize, write_size: usize) { let addr = "127.0.0.1:0".parse().unwrap(); - let mut core = Core::new().unwrap(); + let mut core = Reactor::new().unwrap(); let handle = core.handle(); let listener = TcpListener::bind(&addr, &handle).unwrap(); let addr = listener.local_addr().unwrap(); @@ -255,7 +255,7 @@ mod transfer { // Spawn reactor thread thread::spawn(move || { // Create the core - let mut core = Core::new().unwrap(); + let mut core = Reactor::new().unwrap(); // Reactor handles let handle = core.handle(); diff --git a/examples/chat.rs b/examples/chat.rs index a00237308d1..f22d6b6438f 100644 --- a/examples/chat.rs +++ b/examples/chat.rs @@ -33,7 +33,7 @@ use futures::future::Executor; use futures::stream::{self, Stream}; use futures_cpupool::CpuPool; use tokio::net::TcpListener; -use tokio::reactor::Core; +use tokio::reactor::Reactor; use tokio_io::io; use tokio_io::AsyncRead; @@ -42,7 +42,7 @@ fn main() { let addr = addr.parse().unwrap(); // Create the event loop and TCP listener we'll accept connections on. - let mut core = Core::new().unwrap(); + let mut core = Reactor::new().unwrap(); let handle = core.handle(); let socket = TcpListener::bind(&addr, &handle).unwrap(); println!("Listening on: {}", addr); diff --git a/examples/compress.rs b/examples/compress.rs index 8fedf25e901..d158060f5c7 100644 --- a/examples/compress.rs +++ b/examples/compress.rs @@ -32,7 +32,7 @@ use futures::{Future, Stream, Poll}; use futures::future::Executor; use futures_cpupool::CpuPool; use tokio::net::{TcpListener, TcpStream}; -use tokio::reactor::Core; +use tokio::reactor::Reactor; use tokio_io::{AsyncRead, AsyncWrite}; use flate2::write::GzEncoder; @@ -41,7 +41,7 @@ fn main() { // reactor. let addr = env::args().nth(1).unwrap_or("127.0.0.1:8080".to_string()); let addr = addr.parse::().unwrap(); - let mut core = Core::new().unwrap(); + let mut core = Reactor::new().unwrap(); let handle = core.handle(); let socket = TcpListener::bind(&addr, &handle).unwrap(); println!("Listening on: {}", addr); diff --git a/examples/connect.rs b/examples/connect.rs index 1c3fcb750cf..235da1af531 100644 --- a/examples/connect.rs +++ b/examples/connect.rs @@ -28,7 +28,7 @@ use std::thread; use futures::sync::mpsc; use futures::{Sink, Future, Stream}; use futures_cpupool::CpuPool; -use tokio::reactor::Core; +use tokio::reactor::Reactor; fn main() { // Determine if we're going to run in TCP or UDP mode @@ -48,7 +48,7 @@ fn main() { let addr = addr.parse::().unwrap(); // Create the event loop and initiate the connection to the remote server - let mut core = Core::new().unwrap(); + let mut core = Reactor::new().unwrap(); let handle = core.handle(); let pool = CpuPool::new(1); diff --git a/examples/echo-threads.rs b/examples/echo-threads.rs index 574a6be1a03..ea3ca36219d 100644 --- a/examples/echo-threads.rs +++ b/examples/echo-threads.rs @@ -31,7 +31,7 @@ use futures_cpupool::CpuPool; use tokio_io::AsyncRead; use tokio_io::io::copy; use tokio::net::TcpStream; -use tokio::reactor::Core; +use tokio::reactor::Reactor; fn main() { // First argument, the address to bind @@ -69,7 +69,7 @@ fn main() { } fn worker(rx: mpsc::UnboundedReceiver) { - let mut core = Core::new().unwrap(); + let mut core = Reactor::new().unwrap(); let handle = core.handle(); let pool = CpuPool::new(1); diff --git a/examples/echo-udp.rs b/examples/echo-udp.rs index 631712070c9..0e163efe97a 100644 --- a/examples/echo-udp.rs +++ b/examples/echo-udp.rs @@ -20,7 +20,7 @@ use std::net::SocketAddr; use futures::{Future, Poll}; use tokio::net::UdpSocket; -use tokio::reactor::Core; +use tokio::reactor::Reactor; struct Server { socket: UdpSocket, @@ -56,7 +56,7 @@ fn main() { // Create the event loop that will drive this server, and also bind the // socket we'll be listening to. - let mut l = Core::new().unwrap(); + let mut l = Reactor::new().unwrap(); let handle = l.handle(); let socket = UdpSocket::bind(&addr, &handle).unwrap(); println!("Listening on: {}", socket.local_addr().unwrap()); diff --git a/examples/echo.rs b/examples/echo.rs index fdf0e4cfb32..07c061c4407 100644 --- a/examples/echo.rs +++ b/examples/echo.rs @@ -32,7 +32,7 @@ use futures_cpupool::CpuPool; use tokio_io::AsyncRead; use tokio_io::io::copy; use tokio::net::TcpListener; -use tokio::reactor::Core; +use tokio::reactor::Reactor; fn main() { // Allow passing an address to listen on as the first argument of this @@ -42,15 +42,15 @@ fn main() { let addr = addr.parse::().unwrap(); // First up we'll create the event loop that's going to drive this server. - // This is done by creating an instance of the `Core` type, tokio-core's + // This is done by creating an instance of the `Reactor` type, tokio-core's // event loop. Most functions in tokio-core return an `io::Result`, and - // `Core::new` is no exception. For this example, though, we're mostly just + // `Reactor::new` is no exception. For this example, though, we're mostly just // ignoring errors, so we unwrap the return value. // // After the event loop is created we acquire a handle to it through the // `handle` method. With this handle we'll then later be able to create I/O // objects. - let mut core = Core::new().unwrap(); + let mut core = Reactor::new().unwrap(); let handle = core.handle(); // Next up we create a TCP listener which will listen for incoming @@ -126,7 +126,7 @@ fn main() { }); // And finally now that we've define what our server is, we run it! We - // didn't actually do much I/O up to this point and this `Core::run` method + // didn't actually do much I/O up to this point and this `Reactor::run` method // is responsible for driving the entire server to completion. // // The `run` method will return the result of the future that it's running, diff --git a/examples/hello.rs b/examples/hello.rs index ddbb0e4530e..0bff27e929e 100644 --- a/examples/hello.rs +++ b/examples/hello.rs @@ -20,7 +20,7 @@ use std::env; use std::net::SocketAddr; use futures::stream::Stream; -use tokio::reactor::Core; +use tokio::reactor::Reactor; use tokio::net::TcpListener; fn main() { @@ -28,7 +28,7 @@ fn main() { let addr = env::args().nth(1).unwrap_or("127.0.0.1:8080".to_string()); let addr = addr.parse::().unwrap(); - let mut core = Core::new().unwrap(); + let mut core = Reactor::new().unwrap(); let listener = TcpListener::bind(&addr, &core.handle()).unwrap(); let addr = listener.local_addr().unwrap(); diff --git a/examples/proxy.rs b/examples/proxy.rs index 14a63a7f92e..9d77c54f157 100644 --- a/examples/proxy.rs +++ b/examples/proxy.rs @@ -31,7 +31,7 @@ use futures::{Future, Poll}; use futures::future::Executor; use futures_cpupool::CpuPool; use tokio::net::{TcpListener, TcpStream}; -use tokio::reactor::Core; +use tokio::reactor::Reactor; use tokio_io::{AsyncRead, AsyncWrite}; use tokio_io::io::{copy, shutdown}; @@ -43,7 +43,7 @@ fn main() { let server_addr = server_addr.parse::().unwrap(); // Create the event loop that will drive this server. - let mut l = Core::new().unwrap(); + let mut l = Reactor::new().unwrap(); let handle = l.handle(); let pool = CpuPool::new(1); diff --git a/examples/sink.rs b/examples/sink.rs index fd1cd82bf60..980cb63eebc 100644 --- a/examples/sink.rs +++ b/examples/sink.rs @@ -31,7 +31,7 @@ use futures::stream::{self, Stream}; use futures_cpupool::CpuPool; use tokio_io::IoFuture; use tokio::net::{TcpListener, TcpStream}; -use tokio::reactor::Core; +use tokio::reactor::Reactor; fn main() { env_logger::init().unwrap(); @@ -40,7 +40,7 @@ fn main() { let pool = CpuPool::new(1); - let mut core = Core::new().unwrap(); + let mut core = Reactor::new().unwrap(); let handle = core.handle(); let socket = TcpListener::bind(&addr, &handle).unwrap(); println!("Listening on: {}", addr); diff --git a/examples/tinydb.rs b/examples/tinydb.rs index bfb0d123747..9929e369c82 100644 --- a/examples/tinydb.rs +++ b/examples/tinydb.rs @@ -54,7 +54,7 @@ use futures::prelude::*; use futures::future::Executor; use futures_cpupool::CpuPool; use tokio::net::TcpListener; -use tokio::reactor::Core; +use tokio::reactor::Reactor; use tokio_io::AsyncRead; use tokio_io::io::{lines, write_all}; @@ -80,11 +80,11 @@ enum Response { } fn main() { - // Parse the address we're going to run this server on, create a `Core`, and + // Parse the address we're going to run this server on, create a `Reactor`, and // set up our TCP listener to accept connections. let addr = env::args().nth(1).unwrap_or("127.0.0.1:8080".to_string()); let addr = addr.parse::().unwrap(); - let mut core = Core::new().unwrap(); + let mut core = Reactor::new().unwrap(); let handle = core.handle(); let listener = TcpListener::bind(&addr, &handle).expect("failed to bind"); println!("Listening on: {}", addr); diff --git a/examples/tinyhttp.rs b/examples/tinyhttp.rs index 085bb8018db..f5513992d02 100644 --- a/examples/tinyhttp.rs +++ b/examples/tinyhttp.rs @@ -39,7 +39,7 @@ use futures_cpupool::CpuPool; use http::{Request, Response, StatusCode}; use http::header::HeaderValue; use tokio::net::TcpStream; -use tokio::reactor::Core; +use tokio::reactor::Reactor; use tokio_io::codec::{Encoder, Decoder}; use tokio_io::{AsyncRead}; @@ -70,7 +70,7 @@ fn main() { } fn worker(rx: mpsc::UnboundedReceiver) { - let mut core = Core::new().unwrap(); + let mut core = Reactor::new().unwrap(); let handle = core.handle(); let pool = CpuPool::new(1); diff --git a/examples/udp-codec.rs b/examples/udp-codec.rs index 65a522caf3d..91fde26d036 100644 --- a/examples/udp-codec.rs +++ b/examples/udp-codec.rs @@ -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::Core; +use tokio::reactor::Reactor; pub struct LineCodec; @@ -39,7 +39,7 @@ impl UdpCodec for LineCodec { fn main() { drop(env_logger::init()); - let mut core = Core::new().unwrap(); + let mut core = Reactor::new().unwrap(); let handle = core.handle(); let pool = CpuPool::new(1); diff --git a/src/lib.rs b/src/lib.rs index 6b622ce1ab6..6985add4dca 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -49,11 +49,11 @@ //! use tokio_io::AsyncRead; //! use tokio_io::io::copy; //! use tokio::net::TcpListener; -//! use tokio::reactor::Core; +//! use tokio::reactor::Reactor; //! //! fn main() { //! // Create the event loop that will drive this server. -//! let mut core = Core::new().unwrap(); +//! let mut core = Reactor::new().unwrap(); //! let handle = core.handle(); //! //! let pool = CpuPool::new_num_cpus(); diff --git a/src/reactor/mod.rs b/src/reactor/mod.rs index 4eb8b43cd23..1d9167a2754 100644 --- a/src/reactor/mod.rs +++ b/src/reactor/mod.rs @@ -1,6 +1,6 @@ //! The core reactor driving all I/O. //! -//! This module contains the [`Core`] reactor type which is the event loop for +//! This module contains the [`Reactor`] reactor type which is the event loop for //! all I/O happening in `tokio`. This core reactor (or event loop) is used to //! drive I/O resources. //! @@ -12,11 +12,11 @@ //! Lastly [`PollEvented`] can be used to construct I/O objects that interact //! with the event loop, e.g. [`TcpStream`] in the net module. //! -//! [`Core`]: struct.Core.html +//! [`Reactor`]: struct.Reactor.html //! [`Handle`]: struct.Handle.html //! [`Remote`]: struct.Remote.html -//! [handle_method]: struct.Core.html#method.handle -//! [remote_method]: struct.Core.html#method.remote +//! [handle_method]: struct.Reactor.html#method.handle +//! [remote_method]: struct.Reactor.html#method.remote //! [`PollEvented`]: struct.PollEvented.html //! [`TcpStream`]: ../net/struct.TcpStream.html @@ -44,7 +44,7 @@ pub use self::poll_evented::PollEvented; /// all other I/O events and notifications happening. Each event loop can have /// multiple handles pointing to it, each of which can then be used to create /// various I/O objects to interact with the event loop in interesting ways. -pub struct Core { +pub struct Reactor { /// Reuse the `mio::Events` value across calls to poll. events: mio::Events, @@ -96,10 +96,10 @@ fn _assert_kinds() { _assert::(); } -impl Core { +impl Reactor { /// Creates a new event loop, returning any error that happened during the /// creation. - pub fn new() -> io::Result { + pub fn new() -> io::Result { // Create the I/O poller let io = try!(mio::Poll::new()); @@ -111,7 +111,7 @@ impl Core { mio::Ready::readable(), mio::PollOpt::level())); - Ok(Core { + Ok(Reactor { events: mio::Events::with_capacity(1024), _future_registration: future_pair.0, future_readiness: Arc::new(MySetReadiness(future_pair.1)), @@ -225,9 +225,9 @@ impl Core { } } -impl fmt::Debug for Core { +impl fmt::Debug for Reactor { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - write!(f, "Core") + write!(f, "Reactor") } } diff --git a/src/reactor/poll_evented.rs b/src/reactor/poll_evented.rs index e3cb1992a9a..57e362c4317 100644 --- a/src/reactor/poll_evented.rs +++ b/src/reactor/poll_evented.rs @@ -198,7 +198,7 @@ impl PollEvented { /// /// # Errors /// - /// This function will return an error if the `Core` that this `PollEvented` + /// This function will return an error if the `Reactor` that this `PollEvented` /// is associated with has gone away (been destroyed). The error means that /// the ambient futures task could not be scheduled to receive a /// notification and typically means that the error should be propagated @@ -232,7 +232,7 @@ impl PollEvented { /// /// # Errors /// - /// This function will return an error if the `Core` that this `PollEvented` + /// This function will return an error if the `Reactor` that this `PollEvented` /// is associated with has gone away (been destroyed). The error means that /// the ambient futures task could not be scheduled to receive a /// notification and typically means that the error should be propagated diff --git a/tests/buffered.rs b/tests/buffered.rs index f1680157870..e070a85fe4b 100644 --- a/tests/buffered.rs +++ b/tests/buffered.rs @@ -11,7 +11,7 @@ use futures::Future; use futures::stream::Stream; use tokio_io::io::copy; use tokio::net::TcpListener; -use tokio::reactor::Core; +use tokio::reactor::Reactor; macro_rules! t { ($e:expr) => (match $e { @@ -25,7 +25,7 @@ fn echo_server() { const N: usize = 1024; drop(env_logger::init()); - let mut l = t!(Core::new()); + let mut l = t!(Reactor::new()); let srv = t!(TcpListener::bind(&t!("127.0.0.1:0".parse()), &l.handle())); let addr = t!(srv.local_addr()); diff --git a/tests/chain.rs b/tests/chain.rs index 89621eecc1b..fb38ed82496 100644 --- a/tests/chain.rs +++ b/tests/chain.rs @@ -10,7 +10,7 @@ use futures::Future; use futures::stream::Stream; use tokio_io::io::read_to_end; use tokio::net::TcpListener; -use tokio::reactor::Core; +use tokio::reactor::Reactor; macro_rules! t { ($e:expr) => (match $e { @@ -21,7 +21,7 @@ macro_rules! t { #[test] fn chain_clients() { - let mut l = t!(Core::new()); + let mut l = t!(Reactor::new()); let srv = t!(TcpListener::bind(&t!("127.0.0.1:0".parse()), &l.handle())); let addr = t!(srv.local_addr()); diff --git a/tests/drop-core.rs b/tests/drop-core.rs index d3634545025..d0b143ca9ec 100644 --- a/tests/drop-core.rs +++ b/tests/drop-core.rs @@ -7,11 +7,11 @@ use futures::future; use futures::prelude::*; use futures::sync::oneshot; use tokio::net::TcpListener; -use tokio::reactor::Core; +use tokio::reactor::Reactor; #[test] fn tcp_doesnt_block() { - let core = Core::new().unwrap(); + let core = Reactor::new().unwrap(); let handle = core.handle(); let listener = TcpListener::bind(&"127.0.0.1:0".parse().unwrap(), &handle).unwrap(); drop(core); @@ -20,7 +20,7 @@ fn tcp_doesnt_block() { #[test] fn drop_wakes() { - let core = Core::new().unwrap(); + let core = Reactor::new().unwrap(); let handle = core.handle(); let listener = TcpListener::bind(&"127.0.0.1:0".parse().unwrap(), &handle).unwrap(); let (tx, rx) = oneshot::channel::<()>(); diff --git a/tests/echo.rs b/tests/echo.rs index f9bde3a12bf..ed172ad8c72 100644 --- a/tests/echo.rs +++ b/tests/echo.rs @@ -10,7 +10,7 @@ use std::thread; use futures::Future; use futures::stream::Stream; use tokio::net::TcpListener; -use tokio::reactor::Core; +use tokio::reactor::Reactor; use tokio_io::AsyncRead; use tokio_io::io::copy; @@ -25,7 +25,7 @@ macro_rules! t { fn echo_server() { drop(env_logger::init()); - let mut l = t!(Core::new()); + let mut l = t!(Reactor::new()); let srv = t!(TcpListener::bind(&t!("127.0.0.1:0".parse()), &l.handle())); let addr = t!(srv.local_addr()); diff --git a/tests/limit.rs b/tests/limit.rs index 452e553fa92..b1b1591eb91 100644 --- a/tests/limit.rs +++ b/tests/limit.rs @@ -10,7 +10,7 @@ use futures::Future; use futures::stream::Stream; use tokio_io::io::read_to_end; use tokio::net::TcpListener; -use tokio::reactor::Core; +use tokio::reactor::Reactor; macro_rules! t { ($e:expr) => (match $e { @@ -21,7 +21,7 @@ macro_rules! t { #[test] fn limit() { - let mut l = t!(Core::new()); + let mut l = t!(Reactor::new()); let srv = t!(TcpListener::bind(&t!("127.0.0.1:0".parse()), &l.handle())); let addr = t!(srv.local_addr()); diff --git a/tests/line-frames.rs b/tests/line-frames.rs index 2ff198700ac..5ada4936da6 100644 --- a/tests/line-frames.rs +++ b/tests/line-frames.rs @@ -13,7 +13,7 @@ use futures::{Future, Stream, Sink}; use futures::future::Executor; use futures_cpupool::CpuPool; use tokio::net::{TcpListener, TcpStream}; -use tokio::reactor::Core; +use tokio::reactor::Reactor; use tokio_io::codec::{Encoder, Decoder}; use tokio_io::io::{write_all, read}; use tokio_io::AsyncRead; @@ -55,7 +55,7 @@ impl Encoder for LineCodec { fn echo() { drop(env_logger::init()); - let mut core = Core::new().unwrap(); + let mut core = Reactor::new().unwrap(); let handle = core.handle(); let pool = CpuPool::new(1); diff --git a/tests/pipe-hup.rs b/tests/pipe-hup.rs index 30df27bc741..13aa02c9fd9 100644 --- a/tests/pipe-hup.rs +++ b/tests/pipe-hup.rs @@ -16,7 +16,7 @@ use std::time::Duration; use mio::unix::{UnixReady, EventedFd}; use mio::{PollOpt, Ready, Token}; use mio::event::Evented; -use tokio::reactor::{Core, PollEvented}; +use tokio::reactor::{Reactor, PollEvented}; use tokio_io::io::read_to_end; macro_rules! t { @@ -64,7 +64,7 @@ impl Evented for MyFile { fn hup() { drop(env_logger::init()); - let mut l = t!(Core::new()); + let mut l = t!(Reactor::new()); unsafe { let mut pipes = [0; 2]; assert!(libc::pipe(pipes.as_mut_ptr()) != -1, diff --git a/tests/stream-buffered.rs b/tests/stream-buffered.rs index 8ba74ed2771..3146f2a71a3 100644 --- a/tests/stream-buffered.rs +++ b/tests/stream-buffered.rs @@ -12,7 +12,7 @@ use futures::stream::Stream; use tokio_io::io::copy; use tokio_io::AsyncRead; use tokio::net::TcpListener; -use tokio::reactor::Core; +use tokio::reactor::Reactor; macro_rules! t { ($e:expr) => (match $e { @@ -25,7 +25,7 @@ macro_rules! t { fn echo_server() { drop(env_logger::init()); - let mut l = t!(Core::new()); + let mut l = t!(Reactor::new()); let srv = t!(TcpListener::bind(&t!("127.0.0.1:0".parse()), &l.handle())); let addr = t!(srv.local_addr()); diff --git a/tests/tcp.rs b/tests/tcp.rs index 9ebbefe3f30..7999429b387 100644 --- a/tests/tcp.rs +++ b/tests/tcp.rs @@ -8,7 +8,7 @@ use std::thread; use futures::Future; use futures::stream::Stream; -use tokio::reactor::Core; +use tokio::reactor::Reactor; use tokio::net::{TcpListener, TcpStream}; macro_rules! t { @@ -21,7 +21,7 @@ macro_rules! t { #[test] fn connect() { drop(env_logger::init()); - let mut l = t!(Core::new()); + let mut l = t!(Reactor::new()); let srv = t!(net::TcpListener::bind("127.0.0.1:0")); let addr = t!(srv.local_addr()); let t = thread::spawn(move || { @@ -39,7 +39,7 @@ fn connect() { #[test] fn accept() { drop(env_logger::init()); - let mut l = t!(Core::new()); + let mut l = t!(Reactor::new()); let srv = t!(TcpListener::bind(&t!("127.0.0.1:0".parse()), &l.handle())); let addr = t!(srv.local_addr()); @@ -64,7 +64,7 @@ fn accept() { #[test] fn accept2() { drop(env_logger::init()); - let mut l = t!(Core::new()); + let mut l = t!(Reactor::new()); let srv = t!(TcpListener::bind(&t!("127.0.0.1:0".parse()), &l.handle())); let addr = t!(srv.local_addr()); diff --git a/tests/udp.rs b/tests/udp.rs index 4cc552ff22c..bf2cd68e962 100644 --- a/tests/udp.rs +++ b/tests/udp.rs @@ -8,7 +8,7 @@ use std::net::SocketAddr; use futures::{Future, Poll, Stream, Sink}; use tokio::net::{UdpSocket, UdpCodec}; -use tokio::reactor::Core; +use tokio::reactor::Reactor; macro_rules! t { ($e:expr) => (match $e { @@ -18,7 +18,7 @@ macro_rules! t { } fn send_messages(send: S, recv: R) { - let mut l = t!(Core::new()); + let mut l = t!(Reactor::new()); let mut a = t!(UdpSocket::bind(&([127, 0, 0, 1], 0).into(), &l.handle())); let mut b = t!(UdpSocket::bind(&([127, 0, 0, 1], 0).into(), &l.handle())); let a_addr = t!(a.local_addr()); @@ -166,7 +166,7 @@ impl Future for RecvMessage { #[test] fn send_dgrams() { - let mut l = t!(Core::new()); + let mut l = t!(Reactor::new()); let mut a = t!(UdpSocket::bind(&t!("127.0.0.1:0".parse()), &l.handle())); let mut b = t!(UdpSocket::bind(&t!("127.0.0.1:0".parse()), &l.handle())); let mut buf = [0u8; 50]; @@ -216,7 +216,7 @@ impl UdpCodec for Codec { #[test] fn send_framed() { - let mut l = t!(Core::new()); + let mut l = t!(Reactor::new()); let mut a_soc = t!(UdpSocket::bind(&t!("127.0.0.1:0".parse()), &l.handle())); let mut b_soc = t!(UdpSocket::bind(&t!("127.0.0.1:0".parse()), &l.handle())); let a_addr = t!(a_soc.local_addr());