shutdown

package
v0.0.0-...-5a77029 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 25, 2021 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL