Switch back to futures from crates.io (#113)

Doing so requires copying the `current_thread` executor from GitHub into
the repo.
This commit is contained in:
Carl Lerche
2018-02-06 07:26:21 -08:00
committed by GitHub
parent 567887cc75
commit f0ea9d6f4c
31 changed files with 1313 additions and 70 deletions
+4 -4
View File
@@ -4,7 +4,7 @@ extern crate futures;
use std::thread;
use std::net;
use futures::{future, stream};
use futures::future;
use futures::prelude::*;
use futures::sync::oneshot;
use tokio::net::TcpListener;
@@ -17,7 +17,7 @@ fn tcp_doesnt_block() {
let listener = net::TcpListener::bind("127.0.0.1:0").unwrap();
let listener = TcpListener::from_std(listener, &handle).unwrap();
drop(core);
assert!(stream::blocking(listener.incoming()).next().unwrap().is_err());
assert!(listener.incoming().wait().next().unwrap().is_err());
}
#[test]
@@ -34,9 +34,9 @@ fn drop_wakes() {
drop(tx);
future::ok(())
});
assert!(future::blocking(new_socket.join(drop_tx)).wait().is_err());
assert!(new_socket.join(drop_tx).wait().is_err());
});
drop(future::blocking(rx).wait());
drop(rx.wait());
drop(core);
t.join().unwrap();
}