Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrInterrupted = errors.New("interrupted")
View Source
var InterruptChannel chan os.Signal
InterruptChannel is used to receive SIGINT (Ctrl+C) signals.
View Source
var InterruptHandlersDone = make(chan struct{})
InterruptHandlersDone is closed after all interrupt handlers run the first time an interrupt is signaled.
View Source
var SimulateInterruptChannel = make(chan struct{}, 1)
Functions ¶
func AddInterruptHandler ¶
func AddInterruptHandler(handler func())
AddInterruptHandler adds a handler to call when a SIGINT (Ctrl+C) is received.
func InterruptRequested ¶
func InterruptRequested() bool
InterruptRequested returns true when the channel returned by interruptListener was closed. This simplifies early shutdown slightly since the caller can just use an if statement instead of a select.
func SimulateInterrupt ¶
func SimulateInterrupt()
SimulateInterrupt requests invoking the clean termination process by an internal component instead of a SIGINT.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.