Function jsonrpsee_server::serve_with_graceful_shutdown

source ยท
pub async fn serve_with_graceful_shutdown<S, B, I>(
    io: I,
    service: S,
    stopped: impl Future<Output = ()>,
) -> Result<(), BoxError>
where S: Service<Request<Incoming>, Response = Response<B>> + Clone + Send + 'static, S::Future: Send, S::Response: Send, S::Error: Into<BoxError>, B: Body<Data = Bytes> + Send + 'static, B::Error: Into<BoxError>, I: AsyncRead + AsyncWrite + Send + Unpin + 'static,
Expand description

Serve a service over a TCP connection with graceful shutdown. This means that pending requests will be completed before the server is stopped.