Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MonitorShutdown ¶
func MonitorShutdown(triggerCh <-chan struct{}, handlers ...ShutdownHandler) <-chan struct{}
MonitorShutdown manages shutdown requests, by watching signals and invoking the supplied handlers in order.
It watches SIGTERM and SIGINT OS signals, as well as the trigger channel. When any of them fire, it calls the supplied handlers in order. If any of them errors, it merely logs the error.
Once the shutdown has completed, it closes the returned channel. The caller can watch this channel
Types ¶
type ShutdownHandler ¶
Click to show internal directories.
Click to hide internal directories.