mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-08-18 00:00:09 +02:00
Touch up some of the benchmarks
This commit is contained in:
+14
-2
@@ -6,8 +6,7 @@
|
||||
use std::io;
|
||||
use std::sync::mpsc::TryRecvError;
|
||||
|
||||
use futures::{Poll, Async};
|
||||
use futures::stream::Stream;
|
||||
use futures::{Poll, Async, Sink, AsyncSink, StartSend, Stream};
|
||||
use mio::channel;
|
||||
|
||||
use reactor::{Handle, PollEvented};
|
||||
@@ -82,6 +81,19 @@ impl<T> Sender<T> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<T> Sink for Sender<T> {
|
||||
type SinkItem = T;
|
||||
type SinkError = io::Error;
|
||||
|
||||
fn start_send(&mut self, t: T) -> StartSend<T, io::Error> {
|
||||
Sender::send(self, t).map(|()| AsyncSink::Ready)
|
||||
}
|
||||
|
||||
fn poll_complete(&mut self) -> Poll<(), io::Error> {
|
||||
Ok(().into())
|
||||
}
|
||||
}
|
||||
|
||||
impl<T> Clone for Sender<T> {
|
||||
fn clone(&self) -> Sender<T> {
|
||||
Sender { tx: self.tx.clone() }
|
||||
|
||||
Reference in New Issue
Block a user