@@ -19,7 +19,6 @@ use std::sync::Arc;
19
19
use futures_util:: { FutureExt , StreamExt } ;
20
20
use tokio_executor:: TypedExecutor ;
21
21
use tokio_sync:: { mpsc, oneshot} ;
22
- use tokio_threadpool;
23
22
24
23
use crate :: common:: { Future , Never , Pin , Poll , Unpin , task} ;
25
24
@@ -42,7 +41,7 @@ pub struct Name {
42
41
/// A resolver using blocking `getaddrinfo` calls in a threadpool.
43
42
#[ derive( Clone ) ]
44
43
pub struct GaiResolver {
45
- tx : tokio_threadpool :: Sender ,
44
+ tx : tokio_executor :: threadpool :: Sender ,
46
45
/// A handle to keep the threadpool alive until all `GaiResolver` clones
47
46
/// have been dropped.
48
47
_threadpool_keep_alive : ThreadPoolKeepAlive ,
@@ -114,7 +113,7 @@ impl GaiResolver {
114
113
///
115
114
/// Takes number of DNS worker threads.
116
115
pub fn new ( threads : usize ) -> Self {
117
- let pool = tokio_threadpool :: Builder :: new ( )
116
+ let pool = tokio_executor :: threadpool :: Builder :: new ( )
118
117
. name_prefix ( "hyper-dns-gai-resolver" )
119
118
// not for CPU tasks, so only spawn workers
120
119
// in blocking mode
@@ -296,7 +295,7 @@ impl Iterator for IpAddrs {
296
295
}
297
296
}
298
297
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.
300
299
///
301
300
/// Unlike the `GaiResolver` this will not spawn dedicated threads, but only works when running on the
302
301
/// multi-threaded Tokio runtime.
@@ -332,10 +331,10 @@ impl Future for TokioThreadpoolGaiFuture {
332
331
type Output = Result < GaiAddrs , io:: Error > ;
333
332
334
333
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( ) ) ) {
336
335
Ok ( Ok ( iter) ) => Poll :: Ready ( Ok ( GaiAddrs { inner : IpAddrs { iter } } ) ) ,
337
336
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 :(
339
338
Err ( e) => Poll :: Ready ( Err ( io:: Error :: new ( io:: ErrorKind :: Other , e) ) ) ,
340
339
}
341
340
}
0 commit comments