upgrade to hyper/http 1.0

In the process, no longer wait for pending HTTP requests on shutdown.
This just extended the time Moonfire was running without streaming.
This commit is contained in:
Scott Lamb
2024-08-23 20:56:40 -07:00
parent 8b951200c9
commit 1473e79e96
19 changed files with 386 additions and 424 deletions

View File

@@ -147,6 +147,18 @@ impl<'receiver> Future for ReceiverRefFuture<'receiver> {
}
}
impl Drop for ReceiverRefFuture<'_> {
fn drop(&mut self) {
if self.waker_i == NO_WAKER {
return;
}
let mut l = self.receiver.0.wakers.lock().unwrap();
if let Some(wakers) = &mut *l {
wakers.remove(self.waker_i);
}
}
}
impl Future for ReceiverFuture {
type Output = ();
@@ -156,6 +168,18 @@ impl Future for ReceiverFuture {
}
}
impl Drop for ReceiverFuture {
fn drop(&mut self) {
if self.waker_i == NO_WAKER {
return;
}
let mut l = self.receiver.wakers.lock().unwrap();
if let Some(wakers) = &mut *l {
wakers.remove(self.waker_i);
}
}
}
/// Returns a sender and receiver for graceful shutdown.
///
/// Dropping the sender will request shutdown.