signals

package
v0.0.0-...-ba1c585 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2017 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Overview

Package signals implements utilities for managing process shutdown with support for signal-handling.

Index

Constants

View Source
const (
	STOP               = stopSignal("")
	DoubleStopExitCode = 1
)

Variables

View Source
var SameSignalTimeWindow time.Duration

SameSignalTimeWindow specifies the time window during which multiple deliveries of the same signal are counted as one signal. If set to zero, no such de-duping occurs. This is useful in situations where a process receives a signal explicitly sent by its parent when the parent receives the signal, but also receives it independently by virtue of being part of the same process group.

This is a variable, so that it can be set appropriately. Note, there is no locking around it, the assumption being that it's set during initialization and never reset afterwards.

Functions

func Default

func Default() []os.Signal

Default returns a set of platform-specific signals that applications are encouraged to listen on.

func ShutdownOnSignals

func ShutdownOnSignals(ctx *context.T, signals ...os.Signal) <-chan os.Signal

ShutdownOnSignals registers signal handlers for the specified signals, or, if none are specified, the default signals. The first signal received will be made available on the returned channel; upon receiving a second signal, the process will exit.

Types

This section is empty.

Jump to

Keyboard shortcuts

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