File tree 3 files changed +15
-2
lines changed
3 files changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -137,6 +137,13 @@ impl<B> SendRequest<B> {
137
137
self . dispatch . poll_ready ( cx)
138
138
}
139
139
140
+ /// Waits until the dispatcher is ready
141
+ ///
142
+ /// If the associated connection is closed, this returns an Error.
143
+ pub async fn ready ( & mut self ) -> crate :: Result < ( ) > {
144
+ futures_util:: future:: poll_fn ( |cx| self . poll_ready ( cx) ) . await
145
+ }
146
+
140
147
/*
141
148
pub(super) async fn when_ready(self) -> crate::Result<Self> {
142
149
let mut me = Some(self);
Original file line number Diff line number Diff line change @@ -74,6 +74,13 @@ impl<B> SendRequest<B> {
74
74
}
75
75
}
76
76
77
+ /// Waits until the dispatcher is ready
78
+ ///
79
+ /// If the associated connection is closed, this returns an Error.
80
+ pub async fn ready ( & mut self ) -> crate :: Result < ( ) > {
81
+ futures_util:: future:: poll_fn ( |cx| self . poll_ready ( cx) ) . await
82
+ }
83
+
77
84
/*
78
85
pub(super) async fn when_ready(self) -> crate::Result<Self> {
79
86
let mut me = Some(self);
Original file line number Diff line number Diff line change 41
41
//!
42
42
//! // To send via the same connection again, it may not work as it may not be ready,
43
43
//! // so we have to wait until the request_sender becomes ready.
44
- //! // TODO:(mike) how to handle readiness
45
- //! // request_sender.ready().await?;
44
+ //! request_sender.ready().await?;
46
45
//! let request = Request::builder()
47
46
//! .header("Host", "example.com")
48
47
//! .method("GET")
You can’t perform that action at this time.
0 commit comments