Skip to content

Latest commit

 

History

History
18 lines (12 loc) · 555 Bytes

README.md

File metadata and controls

18 lines (12 loc) · 555 Bytes

gracefulshutdown

Go

gracefulshutdown is a Go library that allows applications to register shutdown handlers to be executed during server shutdown.

Usage

Register a shutdown handler:

gracefulshutdown.AddShutdownHandler(func() error {
    log.Println("Shutting down server")
    return httpServer.Shutdown(ctx)
})

See example/example.go for a full working example.