Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Combine ¶
func Combine(signals ...<-chan struct{}) <-chan struct{}
Combine return a read only channel that closes after receiving anything from one of the given channels
func RequestShutdown ¶
func RequestShutdown() bool
RequestShutdown emulates a received event that is considered as shutdown signal (SIGTERM/SIGINT) This returns whether a collector was notified
func SetupStopSignalContext ¶
SetupStopSignalContext works similarly to SetupStopSignalHandler. It returns two objects. One is an errgroup.Group object (refer to https://godoc.org/golang.org/x/sync/errgroup to see how errgroup.Group works); aother is a channel that is closed when either a SIGTERM or a SIGINT signal is received or when one of the task that was executed by the Group is done.
func SetupStopSignalHandler ¶
func SetupStopSignalHandler() <-chan struct{}
SetupStopSignalHandler registered for SIGTERM and SIGINT. A stop channel is returned which is closed on one of these signals. If a second signal is caught, the program is terminated with exit code 1. copied from https://github.com/kubernetes/apiserver/blob/master/pkg/server/signal.go
Types ¶
This section is empty.