feat(dns): export client::connect::dns module, and

`TokioThreadpoolGaiResolver` type.
This commit is contained in:
Sean McArthur
2018-10-23 12:31:11 -07:00
parent 1e8d6439cf
commit 34d780acd0
5 changed files with 59 additions and 40 deletions

View File

@@ -15,7 +15,7 @@ use tokio_tcp::{TcpStream, ConnectFuture};
use tokio_timer::Delay;
use super::{Connect, Connected, Destination};
use super::dns::{self, GaiResolver, Resolve};
use super::dns::{self, GaiResolver, Resolve, TokioThreadpoolGaiResolver};
/// A connector for the `http` scheme.
///
@@ -99,6 +99,15 @@ impl HttpConnector {
}
}
impl HttpConnector<TokioThreadpoolGaiResolver> {
/// Construct a new HttpConnector using the `TokioThreadpoolGaiResolver`.
///
/// This resolver **requires** the threadpool runtime to be used.
pub fn new_with_tokio_threadpool_resolver() -> Self {
HttpConnector::new_with_resolver(TokioThreadpoolGaiResolver::new())
}
}
impl<R> HttpConnector<R> {
/// Construct a new HttpConnector.