add SendResponse::poll_reset and SendStream::poll_reset to listen for reset streams (#279)
This commit is contained in:
@@ -972,6 +972,22 @@ impl<B: IntoBuf> SendResponse<B> {
|
||||
self.inner.send_reset(reason)
|
||||
}
|
||||
|
||||
/// Polls to be notified when the client resets this stream.
|
||||
///
|
||||
/// If stream is still open, this returns `Ok(Async::NotReady)`, and
|
||||
/// registers the task to be notified if a `RST_STREAM` is received.
|
||||
///
|
||||
/// If a `RST_STREAM` frame is received for this stream, calling this
|
||||
/// method will yield the `Reason` for the reset.
|
||||
///
|
||||
/// # Error
|
||||
///
|
||||
/// Calling this method after having called `send_response` will return
|
||||
/// a user error.
|
||||
pub fn poll_reset(&mut self) -> Poll<Reason, ::Error> {
|
||||
self.inner.poll_reset(proto::PollReset::AwaitingHeaders)
|
||||
}
|
||||
|
||||
// TODO: Support reserving push promises.
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user