@@ -113,14 +113,6 @@ where C: Connect + Sync + 'static,
113
113
114
114
/// Send a constructed Request using this Client.
115
115
pub fn request ( & self , mut req : Request < B > ) -> FutureResponse {
116
- // TODO(0.12): do this at construction time.
117
- //
118
- // It cannot be done in the constructor because the Client::configured
119
- // does not have `B: 'static` bounds, which are required to spawn
120
- // the interval. In 0.12, add a static bounds to the constructor,
121
- // and move this.
122
- self . schedule_pool_timer ( ) ;
123
-
124
116
match req. version ( ) {
125
117
Version :: HTTP_10 |
126
118
Version :: HTTP_11 => ( ) ,
@@ -302,7 +294,7 @@ where C: Connect + Sync + 'static,
302
294
// for a new request to start.
303
295
//
304
296
// It won't be ready if there is a body to stream.
305
- if ver == Ver :: Http2 || pooled. is_ready ( ) {
297
+ if ver == Ver :: Http2 || !pooled . is_pool_enabled ( ) || pooled. is_ready ( ) {
306
298
drop ( pooled) ;
307
299
} else if !res. body ( ) . is_empty ( ) {
308
300
let ( delayed_tx, delayed_rx) = oneshot:: channel ( ) ;
@@ -336,10 +328,6 @@ where C: Connect + Sync + 'static,
336
328
337
329
Box :: new ( resp)
338
330
}
339
-
340
- fn schedule_pool_timer ( & self ) {
341
- self . pool . spawn_expired_interval ( & self . executor ) ;
342
- }
343
331
}
344
332
345
333
impl < C , B > Clone for Client < C , B > {
@@ -474,7 +462,7 @@ impl<B: Payload + 'static> PoolClient<B> {
474
462
475
463
impl < B > Poolable for PoolClient < B >
476
464
where
477
- B : ' static ,
465
+ B : Send + ' static ,
478
466
{
479
467
fn is_open ( & self ) -> bool {
480
468
match self . tx {
@@ -700,7 +688,7 @@ impl Builder {
700
688
executor : self . exec . clone ( ) ,
701
689
h1_writev : self . h1_writev ,
702
690
h1_title_case_headers : self . h1_title_case_headers ,
703
- pool : Pool :: new ( self . keep_alive , self . keep_alive_timeout ) ,
691
+ pool : Pool :: new ( self . keep_alive , self . keep_alive_timeout , & self . exec ) ,
704
692
retry_canceled_requests : self . retry_canceled_requests ,
705
693
set_host : self . set_host ,
706
694
ver : self . ver ,
0 commit comments