Documentation ¶
Overview ¶
Package signals implements utilities for managing process shutdown with support for signal-handling.
Index ¶
Constants ¶
const ( STOP = stopSignal("") DoubleStopExitCode = 1 )
Variables ¶
var SameSignalTimeWindow time.Duration
SameSignalTimeWindow specifies the time window during which multiple deliveries of the same signal are counted as one signal. If set to zero, no such de-duping occurs. This is useful in situations where a process receives a signal explicitly sent by its parent when the parent receives the signal, but also receives it independently by virtue of being part of the same process group.
This is a variable, so that it can be set appropriately. Note, there is no locking around it, the assumption being that it's set during initialization and never reset afterwards.
Functions ¶
func Default ¶
Default returns a set of platform-specific signals that applications are encouraged to listen on.
func ShutdownOnSignals ¶
ShutdownOnSignals registers signal handlers for the specified signals, or, if none are specified, the default signals. The first signal received will be made available on the returned channel; upon receiving a second signal, the process will exit.
Types ¶
This section is empty.