diff --git a/postgres-native-tls/Cargo.toml b/postgres-native-tls/Cargo.toml index 59fde802..fdea8bea 100644 --- a/postgres-native-tls/Cargo.toml +++ b/postgres-native-tls/Cargo.toml @@ -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" } diff --git a/postgres-openssl/Cargo.toml b/postgres-openssl/Cargo.toml index 21198e9d..a44e63ec 100644 --- a/postgres-openssl/Cargo.toml +++ b/postgres-openssl/Cargo.toml @@ -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" } diff --git a/postgres/Cargo.toml b/postgres/Cargo.toml index bc47ae82..fd5b2e83 100644 --- a/postgres/Cargo.toml +++ b/postgres/Cargo.toml @@ -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" diff --git a/tokio-postgres/Cargo.toml b/tokio-postgres/Cargo.toml index 02e4d5ca..92790e96 100644 --- a/tokio-postgres/Cargo.toml +++ b/tokio-postgres/Cargo.toml @@ -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" diff --git a/tokio-postgres/src/connect_socket.rs b/tokio-postgres/src/connect_socket.rs index 5c7d7271..bcb7cfe0 100644 --- a/tokio-postgres/src/connect_socket.rs +++ b/tokio-postgres/src/connect_socket.rs @@ -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> { // 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; }