Skip to main content

serve

Function serve 

Source
pub async fn serve(
    socket: UdpSocket,
    handler: impl Handler,
    config: ServerConfig,
    shutdown: impl Future<Output = ()>,
) -> Result<()>
Expand description

Serve guppy on socket through handler until shutdown resolves.

The handler runs inline on the receive loop (guppy serves small documents; a handler that must do slow work should do it elsewhere and answer fast).