signals

package
v0.0.0-...-d74ee84 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SignalHandlerLoop

func SignalHandlerLoop(log logging.Interface, ss ...SignalReceiver)

SignalHandlerLoop blocks until it receives a SIGINT, SIGTERM or SIGQUIT. For SIGINT and SIGTERM, it exits; for SIGQUIT is print a goroutine stack dump.

Types

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

Handler handles signals, can be interrupted. On SIGINT or SIGTERM it will exit, on SIGQUIT it will dump goroutine stacks to the Logger.

func NewHandler

func NewHandler(log logging.Interface, receivers ...SignalReceiver) *Handler

NewHandler makes a new Handler.

func (*Handler) Loop

func (h *Handler) Loop()

Loop handles signals.

func (*Handler) Stop

func (h *Handler) Stop()

Stop the handler

type SignalReceiver

type SignalReceiver interface {
	Stop() error
}

SignalReceiver represents a subsystem/server/... that can be stopped or queried about the status with a signal

Jump to

Keyboard shortcuts

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