serve_axum_with_graceful_shutdown

Function serve_axum_with_graceful_shutdown 

Source
pub async fn serve_axum_with_graceful_shutdown<M, S, F>(
    listener: TcpListener,
    make_service: M,
    shutdown: F,
    grace: Duration,
) -> Result<()>
where M: for<'a> Service<IncomingStream<'a, TcpListener>, Error = Infallible, Response = S> + Send + 'static, for<'a> <M as Service<IncomingStream<'a, TcpListener>>>::Future: Send, S: Service<Request, Response = Response, Error = Infallible> + Clone + Send + 'static, S::Future: Send, F: Future<Output = ()> + Send + 'static,
Expand description

Serves an Axum application, draining in-flight requests when shutdown fires.

Logs when the signal is received, when drain completes cleanly, or when the grace period expires with work still in flight.