Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ShutdownRequestChannel = make(chan struct{})
ShutdownRequestChannel is used to initiate shutdown from one of the subsystems using the same code paths as when an interrupt signal is received.
Functions ¶
func InterruptListener ¶
func InterruptListener() chan struct{}
InterruptListener listens for OS Signals such as SIGINT (Ctrl+C) and shutdown requests from shutdownRequestChannel. It returns a channel that is closed when either signal is received.
func InterruptRequested ¶
func InterruptRequested(interrupted <-chan struct{}) 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.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.