Remove dead futures2 code. (#538)

The futures 0.2 crate is not intended for widespread usage. Also, the
futures team is exploring the compat shim route.

If futures 0.3 support is added to Tokio 0.1, then a different
integration route will be explored, making the current code unhelpful.
This commit is contained in:
Carl Lerche
2018-08-09 21:56:53 -07:00
committed by GitHub
parent 96b556fbff
commit d91c775f36
31 changed files with 67 additions and 1380 deletions
+1 -21
View File
@@ -2,8 +2,6 @@ use pool::Pool;
use sender::Sender;
use futures::{Future, Poll, Async};
#[cfg(feature = "unstable-futures")]
use futures2;
/// Future that resolves when the thread pool is shutdown.
///
@@ -34,7 +32,7 @@ impl Future for Shutdown {
fn poll(&mut self) -> Poll<(), ()> {
use futures::task;
self.inner().shutdown_task.task1.register_task(task::current());
self.inner().shutdown_task.task.register_task(task::current());
if !self.inner().is_shutdown() {
return Ok(Async::NotReady);
@@ -43,21 +41,3 @@ impl Future for Shutdown {
Ok(().into())
}
}
#[cfg(feature = "unstable-futures")]
impl futures2::Future for Shutdown {
type Item = ();
type Error = ();
fn poll(&mut self, cx: &mut futures2::task::Context) -> futures2::Poll<(), ()> {
trace!("Shutdown::poll");
self.inner().shutdown_task.task2.register(cx.waker());
if 0 != self.inner().num_workers.load(Acquire) {
return Ok(futures2::Async::Pending);
}
Ok(().into())
}
}