@@ -1005,7 +1005,7 @@ impl Builder {
1005
1005
}
1006
1006
}
1007
1007
/// Set an optional timeout for idle sockets being kept-alive.
1008
- /// A `Timer` is required for this to take effect
1008
+ /// A `Timer` is required for this to take effect. See `Builder::pool_timer`
1009
1009
///
1010
1010
/// Pass `None` to disable timeout.
1011
1011
///
@@ -1022,7 +1022,7 @@ impl Builder {
1022
1022
///
1023
1023
/// let client = Client::builder(TokioExecutor::new())
1024
1024
/// .pool_idle_timeout(Duration::from_secs(30))
1025
- /// .timer (TokioTimer::new())
1025
+ /// .pool_timer (TokioTimer::new())
1026
1026
/// .build_http();
1027
1027
///
1028
1028
/// # let infer: Client<_, http_body_util::Full<bytes::Bytes>> = client;
@@ -1389,22 +1389,30 @@ impl Builder {
1389
1389
self
1390
1390
}
1391
1391
1392
- /// Provide a timer to be used for timeouts and intervals.
1392
+ /// Provide a timer to be used for h2
1393
1393
///
1394
1394
/// See the documentation of [`h2::client::Builder::timer`] for more
1395
1395
/// details.
1396
1396
///
1397
1397
/// [`h2::client::Builder::timer`]: https://docs.rs/h2/client/struct.Builder.html#method.timer
1398
1398
pub fn timer < M > ( & mut self , timer : M ) -> & mut Self
1399
1399
where
1400
- M : Timer + Clone + Send + Sync + ' static ,
1400
+ M : Timer + Send + Sync + ' static ,
1401
1401
{
1402
- self . pool_timer = Some ( timer:: Timer :: new ( timer. clone ( ) ) ) ;
1403
1402
#[ cfg( feature = "http2" ) ]
1404
1403
self . h2_builder . timer ( timer) ;
1405
1404
self
1406
1405
}
1407
1406
1407
+ /// Provide a timer to be used for timeouts and intervals in connection pools.
1408
+ pub fn pool_timer < M > ( & mut self , timer : M ) -> & mut Self
1409
+ where
1410
+ M : Timer + Clone + Send + Sync + ' static ,
1411
+ {
1412
+ self . pool_timer = Some ( timer:: Timer :: new ( timer. clone ( ) ) ) ;
1413
+ self
1414
+ }
1415
+
1408
1416
/// Set the maximum write buffer size for each HTTP/2 stream.
1409
1417
///
1410
1418
/// Default is currently 1MB, but may change.
0 commit comments