summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2017-12-05 09:02:07 -0800
committerAlex Crichton <alex@alexcrichton.com>2017-12-05 09:02:07 -0800
commit108e1a2c1a66a6f0123704e42624b51e9536476f (patch)
tree627489b7aa04cd2da9cdfdf53172e235fc7a6827 /examples
parent46062794aaedf1d2f8385124fa5b7061317a2527 (diff)
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'
Diffstat (limited to 'examples')
-rw-r--r--examples/chat.rs4
-rw-r--r--examples/compress.rs4
-rw-r--r--examples/connect.rs4
-rw-r--r--examples/echo-threads.rs4
-rw-r--r--examples/echo-udp.rs4
-rw-r--r--examples/echo.rs10
-rw-r--r--examples/hello.rs4
-rw-r--r--examples/proxy.rs4
-rw-r--r--examples/sink.rs4
-rw-r--r--examples/tinydb.rs6
-rw-r--r--examples/tinyhttp.rs4
-rw-r--r--examples/udp-codec.rs4
12 files changed, 28 insertions, 28 deletions
diff --git a/examples/chat.rs b/examples/chat.rs
index a0023730..f22d6b64 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 8fedf25e..d158060f 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::<SocketAddr>().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 1c3fcb75..235da1af 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::<SocketAddr>().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 574a6be1..ea3ca362 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<net::TcpStream>) {
- 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 63171207..0e163efe 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 fdf0e4cf..07c061c4 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::<SocketAddr>().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 ddbb0e45..0bff27e9 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::<SocketAddr>().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 14a63a7f..9d77c54f 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::<SocketAddr>().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 fd1cd82b..980cb63e 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 bfb0d123..9929e369 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::<SocketAddr>().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 085bb801..f5513992 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<net::TcpStream>) {
- 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 65a522ca..91fde26d 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);