package gracehttp
import "github.com/facebookgo/grace/gracehttp"
Package gracehttp provides easy to use graceful restart functionality for HTTP server.
Index ¶
- func PreStartProcess(hook func() error) option
- func Serve(servers ...*http.Server) error
- func ServeWithOptions(servers []*http.Server, options ...option) error
- func SetLogger(l *log.Logger)
Functions ¶
func PreStartProcess ¶
func PreStartProcess(hook func() error) option
PreStartProcess configures a callback to trigger during graceful restart directly before starting the successor process. This allows the current process to release holds on resources that the new process will need.
func Serve ¶
Serve will serve the given http.Servers and will monitor for signals allowing for graceful termination (SIGTERM) or restart (SIGUSR2).
func ServeWithOptions ¶
ServeWithOptions does the same as Serve, but takes a set of options to configure the app struct.
func SetLogger ¶
SetLogger sets logger to be able to grab some useful logs
Source Files ¶
- Version
- v0.0.0-20180706040059-75cf19382434 (latest)
- Published
- Jul 6, 2018
- Platform
- js/wasm
- Imports
- 12 packages
- Last checked
- 3 weeks ago –
Tools for package owners.