server

command
v0.14.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 7, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Graceful shutdown of an HTTP server.

Run starts the scope, waits for SIGINT/SIGTERM or a Shutdown call, then stops everything in reverse order with a bounded context. The server's OnDrain calls http.Server.Shutdown, which stops accepting connections and waits for in-flight requests until the stop context expires. Draining runs before anything is torn down, so those requests still have their scopes.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL