Following the hyper graceful_shudown.rs example I've ran into a issue with adding graceful_shutdown()
on the connection.
I am using hyper_util::server::conn::auto::Builder
and the serve_connection returns the Connection which should have the graceful_shutdown
method available.
So, when starting the connection via, there are no as_mut()
methods available, nor graceful_shutdown
.
let builder = hyper_util::server::conn::auto::Builder::new(TokioExecutor::new());
let conn = builder.service_connection(TokioIo::new(stream, my_service);
pin!(conn);
clippy also suggests placing conn
in Box::new
, which allows the .as_mut()
, but still not graceful_shutdown()
method available.
Same happens when trying to use hyper::server::conn::http1
instead of the hyper_util::server::conn::auto
.
What I previously had was the standard:
if let Err(e) = Builder::new(TokioExecutor::new()).serve_connection(TokioIo::new(stream), my_service).await {
// Handle the erorrs here
// ....
}
I don't really know what to do and where to look at this point, does anyone have a working example/reference somewhere, or any idea how to help with this.
Thank you !