@@ -974,7 +974,7 @@ mod dispatch_impl {
974
974
. unwrap ( ) ;
975
975
let res = client. request ( req) . map_ok ( move |res| {
976
976
assert_eq ! ( res. status( ) , hyper:: StatusCode :: OK ) ;
977
- tokio_timer:: sleep ( Duration :: from_secs ( 1 ) )
977
+ tokio_timer:: delay_for ( Duration :: from_secs ( 1 ) )
978
978
} ) ;
979
979
let rx = rx1. expect ( "thread panicked" ) ;
980
980
rt. block_on ( future:: join ( res, rx) . map ( |r| r. 0 ) ) . unwrap ( ) ;
@@ -1018,7 +1018,7 @@ mod dispatch_impl {
1018
1018
assert_eq ! ( res. status( ) , hyper:: StatusCode :: OK ) ;
1019
1019
res. into_body ( ) . try_concat ( )
1020
1020
} ) . map_ok ( |_| {
1021
- tokio_timer:: sleep ( Duration :: from_secs ( 1 ) )
1021
+ tokio_timer:: delay_for ( Duration :: from_secs ( 1 ) )
1022
1022
} )
1023
1023
} ;
1024
1024
// client is dropped
@@ -1082,7 +1082,7 @@ mod dispatch_impl {
1082
1082
}
1083
1083
drop ( client) ;
1084
1084
1085
- let t = tokio_timer:: sleep ( Duration :: from_millis ( 100 ) )
1085
+ let t = tokio_timer:: delay_for ( Duration :: from_millis ( 100 ) )
1086
1086
. map ( |_| panic ! ( "time out" ) ) ;
1087
1087
let close = closes
1088
1088
. into_future ( )
@@ -1131,7 +1131,7 @@ mod dispatch_impl {
1131
1131
rt. block_on ( future:: select ( res, rx1) ) ;
1132
1132
1133
1133
// res now dropped
1134
- let t = tokio_timer:: sleep ( Duration :: from_millis ( 100 ) )
1134
+ let t = tokio_timer:: delay_for ( Duration :: from_millis ( 100 ) )
1135
1135
. map ( |_| panic ! ( "time out" ) ) ;
1136
1136
let close = closes
1137
1137
. into_future ( )
@@ -1180,7 +1180,7 @@ mod dispatch_impl {
1180
1180
let rx = rx1. expect ( "thread panicked" ) ;
1181
1181
rt. block_on ( future:: join ( res, rx) . map ( |r| r. 0 ) ) . unwrap ( ) ;
1182
1182
1183
- let t = tokio_timer:: sleep ( Duration :: from_millis ( 100 ) )
1183
+ let t = tokio_timer:: delay_for ( Duration :: from_millis ( 100 ) )
1184
1184
. map ( |_| panic ! ( "time out" ) ) ;
1185
1185
let close = closes
1186
1186
. into_future ( )
@@ -1230,7 +1230,7 @@ mod dispatch_impl {
1230
1230
let rx = rx1. expect ( "thread panicked" ) ;
1231
1231
rt. block_on ( future:: join ( res, rx) . map ( |r| r. 0 ) ) . unwrap ( ) ;
1232
1232
1233
- let t = tokio_timer:: sleep ( Duration :: from_millis ( 100 ) )
1233
+ let t = tokio_timer:: delay_for ( Duration :: from_millis ( 100 ) )
1234
1234
. map ( |_| panic ! ( "time out" ) ) ;
1235
1235
let close = closes
1236
1236
. into_future ( )
@@ -1274,7 +1274,7 @@ mod dispatch_impl {
1274
1274
let rx = rx1. expect ( "thread panicked" ) ;
1275
1275
rt. block_on ( future:: join ( res, rx) . map ( |r| r. 0 ) ) . unwrap ( ) ;
1276
1276
1277
- let t = tokio_timer:: sleep ( Duration :: from_millis ( 100 ) )
1277
+ let t = tokio_timer:: delay_for ( Duration :: from_millis ( 100 ) )
1278
1278
. map ( |_| panic ! ( "time out" ) ) ;
1279
1279
let close = closes
1280
1280
. into_future ( )
@@ -1469,7 +1469,7 @@ mod dispatch_impl {
1469
1469
assert_eq ! ( connects. load( Ordering :: Relaxed ) , 0 ) ;
1470
1470
1471
1471
let delayed_body = rx1
1472
- . then ( |_| tokio_timer:: sleep ( Duration :: from_millis ( 200 ) ) )
1472
+ . then ( |_| tokio_timer:: delay_for ( Duration :: from_millis ( 200 ) ) )
1473
1473
. map ( |_| Ok :: < _ , ( ) > ( "hello a" ) )
1474
1474
. map_err ( |_| -> hyper:: Error { panic ! ( "rx1" ) } )
1475
1475
. into_stream ( ) ;
@@ -1484,7 +1484,7 @@ mod dispatch_impl {
1484
1484
1485
1485
// req 1
1486
1486
let fut = future:: join ( client. request ( req) , rx)
1487
- . then ( |_| tokio_timer:: sleep ( Duration :: from_millis ( 200 ) ) )
1487
+ . then ( |_| tokio_timer:: delay_for ( Duration :: from_millis ( 200 ) ) )
1488
1488
// req 2
1489
1489
. then ( move |( ) | {
1490
1490
let rx = rx3. expect ( "thread panicked" ) ;
@@ -1838,7 +1838,7 @@ mod conn {
1838
1838
res. into_body ( ) . try_concat ( )
1839
1839
} ) ;
1840
1840
let rx = rx1. expect ( "thread panicked" ) ;
1841
- let rx = rx. then ( |_| tokio_timer:: sleep ( Duration :: from_millis ( 200 ) ) ) ;
1841
+ let rx = rx. then ( |_| tokio_timer:: delay_for ( Duration :: from_millis ( 200 ) ) ) ;
1842
1842
rt. block_on ( future:: join ( res, rx) . map ( |r| r. 0 ) ) . unwrap ( ) ;
1843
1843
}
1844
1844
@@ -1884,7 +1884,7 @@ mod conn {
1884
1884
} ) ;
1885
1885
1886
1886
let rx = rx1. expect ( "thread panicked" ) ;
1887
- let rx = rx. then ( |_| tokio_timer:: sleep ( Duration :: from_millis ( 200 ) ) ) ;
1887
+ let rx = rx. then ( |_| tokio_timer:: delay_for ( Duration :: from_millis ( 200 ) ) ) ;
1888
1888
let chunk = rt. block_on ( future:: join ( res, rx) . map ( |r| r. 0 ) ) . unwrap ( ) ;
1889
1889
assert_eq ! ( chunk. len( ) , 5 ) ;
1890
1890
}
@@ -1976,7 +1976,7 @@ mod conn {
1976
1976
res. into_body ( ) . try_concat ( )
1977
1977
} ) ;
1978
1978
let rx = rx1. expect ( "thread panicked" ) ;
1979
- let rx = rx. then ( |_| tokio_timer:: sleep ( Duration :: from_millis ( 200 ) ) ) ;
1979
+ let rx = rx. then ( |_| tokio_timer:: delay_for ( Duration :: from_millis ( 200 ) ) ) ;
1980
1980
rt. block_on ( future:: join ( res, rx) . map ( |r| r. 0 ) ) . unwrap ( ) ;
1981
1981
}
1982
1982
@@ -2020,7 +2020,7 @@ mod conn {
2020
2020
res. into_body ( ) . try_concat ( )
2021
2021
} ) ;
2022
2022
let rx = rx1. expect ( "thread panicked" ) ;
2023
- let rx = rx. then ( |_| tokio_timer:: sleep ( Duration :: from_millis ( 200 ) ) ) ;
2023
+ let rx = rx. then ( |_| tokio_timer:: delay_for ( Duration :: from_millis ( 200 ) ) ) ;
2024
2024
rt. block_on ( future:: join ( res, rx) . map ( |r| r. 0 ) ) . unwrap ( ) ;
2025
2025
}
2026
2026
@@ -2072,7 +2072,7 @@ mod conn {
2072
2072
} ) ;
2073
2073
2074
2074
let rx = rx1. expect ( "thread panicked" ) ;
2075
- let rx = rx. then ( |_| tokio_timer:: sleep ( Duration :: from_millis ( 200 ) ) ) ;
2075
+ let rx = rx. then ( |_| tokio_timer:: delay_for ( Duration :: from_millis ( 200 ) ) ) ;
2076
2076
rt. block_on ( future:: join3 ( res1, res2, rx) . map ( |r| r. 0 ) ) . unwrap ( ) ;
2077
2077
}
2078
2078
@@ -2132,7 +2132,7 @@ mod conn {
2132
2132
} ) ;
2133
2133
2134
2134
let rx = rx1. expect ( "thread panicked" ) ;
2135
- let rx = rx. then ( |_| tokio_timer:: sleep ( Duration :: from_millis ( 200 ) ) ) ;
2135
+ let rx = rx. then ( |_| tokio_timer:: delay_for ( Duration :: from_millis ( 200 ) ) ) ;
2136
2136
rt. block_on ( future:: join3 ( until_upgrade, res, rx) . map ( |r| r. 0 ) ) . unwrap ( ) ;
2137
2137
2138
2138
// should not be ready now
@@ -2220,7 +2220,7 @@ mod conn {
2220
2220
} ) ;
2221
2221
2222
2222
let rx = rx1. expect ( "thread panicked" ) ;
2223
- let rx = rx. then ( |_| tokio_timer:: sleep ( Duration :: from_millis ( 200 ) ) ) ;
2223
+ let rx = rx. then ( |_| tokio_timer:: delay_for ( Duration :: from_millis ( 200 ) ) ) ;
2224
2224
rt. block_on ( future:: join3 ( until_tunneled, res, rx) . map ( |r| r. 0 ) ) . unwrap ( ) ;
2225
2225
2226
2226
// should not be ready now
@@ -2296,7 +2296,7 @@ mod conn {
2296
2296
let _ = shdn_tx. send ( ( ) ) ;
2297
2297
2298
2298
// Allow time for graceful shutdown roundtrips...
2299
- rt. block_on ( tokio_timer:: sleep ( Duration :: from_millis ( 100 ) ) ) ;
2299
+ rt. block_on ( tokio_timer:: delay_for ( Duration :: from_millis ( 100 ) ) ) ;
2300
2300
2301
2301
// After graceful shutdown roundtrips, the client should be closed...
2302
2302
rt. block_on ( future:: poll_fn ( |ctx| client. poll_ready ( ctx) ) ) . expect_err ( "client should be closed" ) ;
0 commit comments