@@ -19,7 +19,6 @@ use std::sync::Arc;
1919use futures_util:: { FutureExt , StreamExt } ;
2020use tokio_executor:: TypedExecutor ;
2121use tokio_sync:: { mpsc, oneshot} ;
22- use tokio_threadpool;
2322
2423use crate :: common:: { Future , Never , Pin , Poll , Unpin , task} ;
2524
@@ -42,7 +41,7 @@ pub struct Name {
4241/// A resolver using blocking `getaddrinfo` calls in a threadpool.
4342#[ derive( Clone ) ]
4443pub struct GaiResolver {
45- tx : tokio_threadpool :: Sender ,
44+ tx : tokio_executor :: threadpool :: Sender ,
4645 /// A handle to keep the threadpool alive until all `GaiResolver` clones
4746 /// have been dropped.
4847 _threadpool_keep_alive : ThreadPoolKeepAlive ,
@@ -114,7 +113,7 @@ impl GaiResolver {
114113 ///
115114 /// Takes number of DNS worker threads.
116115 pub fn new ( threads : usize ) -> Self {
117- let pool = tokio_threadpool :: Builder :: new ( )
116+ let pool = tokio_executor :: threadpool :: Builder :: new ( )
118117 . name_prefix ( "hyper-dns-gai-resolver" )
119118 // not for CPU tasks, so only spawn workers
120119 // in blocking mode
@@ -296,7 +295,7 @@ impl Iterator for IpAddrs {
296295 }
297296}
298297
299- /// A resolver using `getaddrinfo` calls via the `tokio_threadpool ::blocking` API.
298+ /// A resolver using `getaddrinfo` calls via the `tokio_executor::threadpool ::blocking` API.
300299///
301300/// Unlike the `GaiResolver` this will not spawn dedicated threads, but only works when running on the
302301/// multi-threaded Tokio runtime.
@@ -332,10 +331,10 @@ impl Future for TokioThreadpoolGaiFuture {
332331 type Output = Result < GaiAddrs , io:: Error > ;
333332
334333 fn poll ( mut self : Pin < & mut Self > , cx : & mut task:: Context < ' _ > ) -> Poll < Self :: Output > {
335- match ready ! ( tokio_threadpool :: blocking( || ( self . name. as_str( ) , 0 ) . to_socket_addrs( ) ) ) {
334+ match ready ! ( tokio_executor :: threadpool :: blocking( || ( self . name. as_str( ) , 0 ) . to_socket_addrs( ) ) ) {
336335 Ok ( Ok ( iter) ) => Poll :: Ready ( Ok ( GaiAddrs { inner : IpAddrs { iter } } ) ) ,
337336 Ok ( Err ( e) ) => Poll :: Ready ( Err ( e) ) ,
338- // a BlockingError, meaning not on a tokio_threadpool :(
337+ // a BlockingError, meaning not on a tokio_executor::threadpool :(
339338 Err ( e) => Poll :: Ready ( Err ( io:: Error :: new ( io:: ErrorKind :: Other , e) ) ) ,
340339 }
341340 }
0 commit comments