13
13
//! ```no_run
14
14
//! # #[cfg(all(feature = "client", feature = "http1", feature = "runtime"))]
15
15
//! # mod rt {
16
- //! use tower::ServiceExt;
17
16
//! use http::{Request, StatusCode};
18
17
//! use hyper::{client::conn, Body};
19
18
//! use tokio::net::TcpStream;
39
38
//! let response = request_sender.send_request(request).await?;
40
39
//! assert!(response.status() == StatusCode::OK);
41
40
//!
42
- //! // To send via the same connection again, it may not work as it may not be ready,
43
- //! // so we have to wait until the request_sender becomes ready.
44
- //! request_sender.ready().await?;
45
41
//! let request = Request::builder()
46
42
//! .header("Host", "example.com")
47
43
//! .method("GET")
@@ -67,7 +63,6 @@ use futures_util::future;
67
63
use httparse:: ParserConfig ;
68
64
use pin_project_lite:: pin_project;
69
65
use tokio:: io:: { AsyncRead , AsyncWrite } ;
70
- use tower_service:: Service ;
71
66
use tracing:: { debug, trace} ;
72
67
73
68
use super :: dispatch;
@@ -83,6 +78,7 @@ use crate::rt::Executor;
83
78
#[ cfg( feature = "http1" ) ]
84
79
use crate :: upgrade:: Upgraded ;
85
80
use crate :: { Body , Request , Response } ;
81
+ use crate :: service:: Service ;
86
82
87
83
#[ cfg( feature = "http1" ) ]
88
84
pub mod http1;
@@ -292,10 +288,6 @@ where
292
288
type Error = crate :: Error ;
293
289
type Future = ResponseFuture ;
294
290
295
- fn poll_ready ( & mut self , cx : & mut task:: Context < ' _ > ) -> Poll < Result < ( ) , Self :: Error > > {
296
- self . poll_ready ( cx)
297
- }
298
-
299
291
fn call ( & mut self , req : Request < B > ) -> Self :: Future {
300
292
self . send_request ( req)
301
293
}
0 commit comments