mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-09-08 00:00:13 +02:00
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'
This commit is contained in:
+2
-2
@@ -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());
|
||||
|
||||
|
||||
+2
-2
@@ -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());
|
||||
|
||||
|
||||
+3
-3
@@ -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::<()>();
|
||||
|
||||
+2
-2
@@ -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());
|
||||
|
||||
|
||||
+2
-2
@@ -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());
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
+2
-2
@@ -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,
|
||||
|
||||
@@ -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());
|
||||
|
||||
|
||||
+4
-4
@@ -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());
|
||||
|
||||
|
||||
+4
-4
@@ -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<S: SendFn + Clone, R: RecvFn + Clone>(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<R: RecvFn> Future for RecvMessage<R> {
|
||||
|
||||
#[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());
|
||||
|
||||
Reference in New Issue
Block a user