Tweak TaskIo wording and such

* Remove TaskIo
* task_split -> split
* TaskIoRead -> ReadHalf
* TaskIoWrite -> WriteHalf

Closes #18
This commit is contained in:
Alex Crichton
2016-09-07 22:12:14 -07:00
parent 6c045d31ac
commit e60002b653
7 changed files with 46 additions and 114 deletions
+2 -3
View File
@@ -9,7 +9,7 @@ use std::net::SocketAddr;
use futures::Future;
use futures::stream::Stream;
use tokio_core::io::{copy, TaskIo};
use tokio_core::io::{copy, Io};
use tokio_core::net::TcpListener;
use tokio_core::reactor::Core;
@@ -35,8 +35,7 @@ fn main() {
// We use the `io::copy` future to copy all data from the
// reading half onto the writing half.
socket.incoming().for_each(move |(socket, addr)| {
let socket = futures::lazy(|| futures::finished(TaskIo::new(socket)));
let pair = socket.map(|s| s.split());
let pair = futures::lazy(|| futures::finished(socket.split()));
let amt = pair.and_then(|(reader, writer)| copy(reader, writer));
// Once all that is done we print out how much we wrote, and then