Documentation
¶
Overview ¶
Package shutdown provides graceful shutdown orchestration for services.
Index ¶
Constants ¶
View Source
const DefaultShutdownTimeout = 30 * time.Second
DefaultShutdownTimeout is the default time allowed for graceful shutdown.
Variables ¶
This section is empty.
Functions ¶
func Register ¶
func Register(h Handler)
Register adds a shutdown handler. Handlers are called in LIFO order.
func Shutdown ¶
Shutdown executes all registered handlers in LIFO order. Returns a combined error if any handler fails.
func WaitForSignal ¶
WaitForSignal blocks until SIGINT or SIGTERM is received, then calls Shutdown with DefaultShutdownTimeout.
Types ¶
Click to show internal directories.
Click to hide internal directories.