Skip to main content

serve

Function serve 

Source
pub async fn serve(
    listener: TcpListener,
    state: AdminState,
    shutdown: Receiver<()>,
) -> Result<()>
Expand description

Serve admin RPC methods on listener until shutdown fires.

Concurrency is capped via ServerConfig::max_connections; shutdown is signalled by calling ServerHandle::stop(), then we await stopped() so a caller that drops the future cannot leave the background accept loop running.