Update futures-preview/tokio

This commit is contained in:
Steven Fackler 2019-08-18 09:02:21 -04:00
parent 1b5d65d462
commit aa44090fad
5 changed files with 20 additions and 19 deletions

View File

@ -16,12 +16,12 @@ default = ["runtime"]
runtime = ["tokio-postgres/runtime"]
[dependencies]
futures-preview = "=0.3.0-alpha.17"
futures-preview = "=0.3.0-alpha.18"
native-tls = "0.2"
tokio-io = "=0.2.0-alpha.1"
tokio-tls = "=0.3.0-alpha.1"
tokio-io = "=0.2.0-alpha.2"
tokio-tls = "=0.3.0-alpha.2"
tokio-postgres = { version = "0.4.0-rc.1", path = "../tokio-postgres", default-features = false }
[dev-dependencies]
tokio = "=0.2.0-alpha.1"
tokio = "=0.2.0-alpha.2"
postgres = { version = "0.16.0-rc.1", path = "../postgres" }

View File

@ -16,12 +16,12 @@ default = ["runtime"]
runtime = ["tokio-postgres/runtime"]
[dependencies]
futures-preview = "=0.3.0-alpha.17"
futures-preview = "=0.3.0-alpha.18"
openssl = "0.10"
tokio-io = "=0.2.0-alpha.1"
tokio-openssl = "=0.4.0-alpha.1"
tokio-io = "=0.2.0-alpha.2"
tokio-openssl = "=0.4.0-alpha.2"
tokio-postgres = { version = "0.4.0-rc.1", path = "../tokio-postgres", default-features = false }
[dev-dependencies]
tokio = "=0.2.0-alpha.1"
tokio = "=0.2.0-alpha.2"
postgres = { version = "0.16.0-rc.1", path = "../postgres" }

View File

@ -30,14 +30,14 @@ runtime = ["tokio-postgres/runtime", "tokio", "lazy_static", "log"]
[dependencies]
bytes = "0.4"
fallible-iterator = "0.2"
futures-preview = "=0.3.0-alpha.17"
futures-preview = "=0.3.0-alpha.18"
pin-utils = "=0.1.0-alpha.4"
tokio-postgres = { version = "0.4.0-rc.2", path = "../tokio-postgres", default-features = false }
tokio-executor = "=0.2.0-alpha.1"
tokio-executor = "=0.2.0-alpha.2"
tokio = { version = "=0.2.0-alpha.1", optional = true }
tokio = { version = "=0.2.0-alpha.2", optional = true }
lazy_static = { version = "1.0", optional = true }
log = { version = "0.4", optional = true }
[dev-dependencies]
tokio = "=0.2.0-alpha.1"
tokio = "=0.2.0-alpha.2"

View File

@ -21,7 +21,7 @@ circle-ci = { repository = "sfackler/rust-postgres" }
[features]
default = ["runtime"]
runtime = ["tokio/rt-full", "tokio/tcp", "tokio/uds", "tokio-threadpool", "lazy_static"]
runtime = ["tokio/rt-full", "tokio/tcp", "tokio/uds", "tokio-executor", "lazy_static"]
"with-bit-vec-0_5" = ["bit-vec-05"]
"with-chrono-0_4" = ["chrono-04"]
@ -33,16 +33,16 @@ with-serde_json-1 = ["serde-1", "serde_json-1"]
[dependencies]
bytes = "0.4"
fallible-iterator = "0.2"
futures-preview = { version = "=0.3.0-alpha.17", features = ["nightly", "async-await"] }
futures-preview = { version = "=0.3.0-alpha.18", features = ["nightly", "async-await"] }
log = "0.4"
parking_lot = "0.9"
percent-encoding = "1.0"
pin-utils = "=0.1.0-alpha.4"
phf = "0.7.23"
postgres-protocol = { version = "0.4.1", path = "../postgres-protocol" }
tokio = { version = "=0.2.0-alpha.1", default-features = false, features = ["io", "codec"] }
tokio = { version = "=0.2.0-alpha.2", default-features = false, features = ["io", "codec"] }
tokio-threadpool = { version = "=0.2.0-alpha.1", optional = true }
tokio-executor = { version = "=0.2.0-alpha.2", optional = true }
lazy_static = { version = "1.0", optional = true }
bit-vec-05 = { version = "0.5", package = "bit-vec", optional = true }
@ -54,5 +54,5 @@ serde_json-1 = { version = "1.0", package = "serde_json", optional = true }
uuid-07 = { version = "0.7", package = "uuid", optional = true }
[dev-dependencies]
tokio = "=0.2.0-alpha.1"
tokio = "=0.2.0-alpha.2"
env_logger = "0.5"

View File

@ -1,16 +1,17 @@
use crate::config::Host;
use crate::{Error, Socket};
use std::vec;
use futures::channel::oneshot;
use futures::future;
use std::future::Future;
use std::net::{IpAddr, SocketAddr, ToSocketAddrs};
use std::time::Duration;
use std::vec;
use std::{io, thread};
use tokio::net::TcpStream;
#[cfg(unix)]
use tokio::net::UnixStream;
use tokio::timer::Timeout;
use tokio_executor::threadpool;
pub(crate) async fn connect_socket(
host: &Host,
@ -67,7 +68,7 @@ pub(crate) async fn connect_socket(
async fn dns(host: &str, port: u16) -> io::Result<vec::IntoIter<SocketAddr>> {
// if we're running on a threadpool, use its blocking support
if let Ok(r) =
future::poll_fn(|_| tokio_threadpool::blocking(|| (host, port).to_socket_addrs())).await
future::poll_fn(|_| threadpool::blocking(|| (host, port).to_socket_addrs())).await
{
return r;
}