use std::{future::Future, net::SocketAddr};
pub async fn serve_health_with_shutdown<F>(
addr: SocketAddr,
shutdown: F,
) -> Result<(), tonic::transport::Error>
where
F: Future<Output = ()> + Send + 'static,
{
let (_reporter, health_service) = tonic_health::server::health_reporter();
tonic::transport::Server::builder()
.add_service(health_service)
.serve_with_shutdown(addr, shutdown)
.await
}