Documentation ¶
Overview ¶
Package graceful orchestrates shutdown gracefully.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ErrTimeout ¶
type ErrTimeout []string
ErrTimeout describes tasks that failed to finish in time.
type Switch ¶
type Switch struct {
// contains filtered or unexported fields
}
Switch is graceful shutdown handler.
Please use NewSwitch to create an instance.
func NewSwitch ¶
NewSwitch creates shutdown handler that triggers on any of provided OS signals and allows registered tasks to take up to provided timeout.
When switch is triggered, tasks are invoked concurrently.
func (*Switch) OnShutdown ¶
OnShutdown adds a named task to run on shutdown.
Click to show internal directories.
Click to hide internal directories.