Registry / networking / tylerb-graceful

tylerb-graceful

JSON →
library1.2.15gogounverified

A Go package for gracefully shutting down HTTP servers with a configurable timeout.

go get github.com/tylerb/graceful
INSTALL
IMPORT
SIG · TYLERB-GRACEFUL
T
tylerb-graceful
networkinggov1.2.15
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

graceful
github.com/tylerb/graceful

Creates a graceful HTTP server that shuts down cleanly after a timeout.

package main import ( "net/http" "github.com/tylerb/graceful" ) func main() { srv := &graceful.Server{ Timeout: 10 * time.Second, Server: &http.Server{Addr: ":8080"}, } srv.ListenAndServe() }
Debug
Known issues
gotchaPackage is no longer actively maintained; consider using the standard library's http.Server.Shutdown() method.
fix
Replace with net/http's built-in graceful shutdown using Shutdown() and context.
affects: >=1.2.0
Upgrade
Version history
1.2.15latest on pkg.go.dev
Audit
Dependencies

No dependency data recorded yet.

Agent activity
13 hits · last 30 days
node
12
OpenAI (training)
1
Resources
tylerb-graceful — go get tylerb-graceful · libregistry