Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NotifyShutdownSignals ¶ added in v0.31.0
NotifyShutdownSignals derives a context that ends when the process is asked to stop, and hands the signals back to the runtime once that has happened.
Handing them back is the difference from signal.NotifyContext, which leaves the handler installed with nothing draining its channel: a second Ctrl-C, or a second SIGTERM aimed at a shutdown that has wedged, is swallowed, and the operator who meant "stop now" is left reaching for SIGKILL. Restoring the default disposition makes the second signal do what sending it twice means. It is also what oklog/run's SignalHandler does, via the signal.Stop it defers around its own channel.
Types ¶
This section is empty.