Skip to main content

spawn_http_server

Function spawn_http_server 

Source
pub async fn spawn_http_server<H>(
    cfg: HttpServerConfig,
    handler: Arc<H>,
    cancel: CancellationToken,
) -> Result<Vec<JoinHandle<()>>, HttpServerError>
where H: Handler,
Expand description

Spawn one accept loop per bind address. Returns the spawned task handles; each task runs until cancel fires or the listener errors fatally.

ยงErrors

On the first bind failure, returns the error and aborts any tasks spawned for earlier (already-bound) addresses so the daemon does not end up serving a partial bind set.