Simultaneous futures compat (#172)

This patch adds opt-in support for futures 0.2.
This commit is contained in:
Aaron Turon
2018-03-13 13:57:35 -07:00
committed by Carl Lerche
parent 5846b3fc2a
commit d304791c0e
27 changed files with 1045 additions and 105 deletions
+4 -3
View File
@@ -1,7 +1,7 @@
use {Reactor, Handle};
use {Reactor, Handle, Task};
use atomic_task::AtomicTask;
use futures::{Future, Async, Poll};
use futures::{Future, Async, Poll, task};
use std::io;
use std::thread;
@@ -136,7 +136,8 @@ impl Future for Shutdown {
type Error = ();
fn poll(&mut self) -> Poll<(), ()> {
self.inner.shared.shutdown_task.register();
let task = Task::Futures1(task::current());
self.inner.shared.shutdown_task.register(task);
if !self.inner.is_shutdown() {
return Ok(Async::NotReady);