mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-08-28 00:00:11 +02:00
Re-work I/O
* Auto-register interest whenever we see WouldBlock
* Remove implementations of `Stream<Item=Ready>`, no longer needed
* Add explicit `poll_{read,write}` methods, if needed
* Remove all I/O streams, libstd ones suffice
* Update all I/O futures
This commit is contained in:
+3
-3
@@ -1,7 +1,7 @@
|
||||
use std::io;
|
||||
use std::time::{Duration, Instant};
|
||||
|
||||
use futures::{Future, Task, Poll};
|
||||
use futures::{Future, Poll};
|
||||
use futures_io::IoFuture;
|
||||
|
||||
use LoopHandle;
|
||||
@@ -50,12 +50,12 @@ impl Future for Timeout {
|
||||
type Item = ();
|
||||
type Error = io::Error;
|
||||
|
||||
fn poll(&mut self, task: &mut Task) -> Poll<(), io::Error> {
|
||||
fn poll(&mut self) -> Poll<(), io::Error> {
|
||||
// TODO: is this fast enough?
|
||||
if self.at <= Instant::now() {
|
||||
Poll::Ok(())
|
||||
} else {
|
||||
self.handle.update_timeout(&self.token, task);
|
||||
self.handle.update_timeout(&self.token);
|
||||
Poll::NotReady
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user