Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Actions = ArrayOfParameterlessFunctions{}
Actions - see RunSignalListener
View Source
var Sigs *chan os.Signal
Sigs holds a channel accepting os signals
View Source
var Timeout = time.Second * 1
Timeout is used to handle "graceful shutdown". When it passes, os.Exit(ExitCodeGracefulShutdownTimeout) is called zero value means "no timeout"
Functions ¶
func InitiateGracefulShutdown ¶
func InitiateGracefulShutdown()
InitiateGracefulShutdown starts the shutdown process and returns without delay Intended to be called by the user's code (including request handlers), in contrast with signal-based shutdown initiated from the outer world
func RunSignalListener ¶
func RunSignalListener()
RunSignalListener creates a listener to catch SIGINT and SIGTERM. When signal arrives, functions from Actions are run sequentially. Time spent is controlled by the Timeout
Types ¶
type ArrayOfParameterlessFunctions ¶
type ArrayOfParameterlessFunctions = []func()
ArrayOfParameterlessFunctions is a type for Actions variable
Click to show internal directories.
Click to hide internal directories.