signal

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2024 License: MIT Imports: 4 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInterrupted = errors.New("interrupted")
View Source
var InterruptChannel chan os.Signal

InterruptChannel is used to receive SIGINT (Ctrl+C) signals.

View Source
var InterruptHandlersDone = make(chan struct{})

InterruptHandlersDone is closed after all interrupt handlers run the first time an interrupt is signaled.

View Source
var SimulateInterruptChannel = make(chan struct{}, 1)

Functions

func AddInterruptHandler

func AddInterruptHandler(handler func())

AddInterruptHandler adds a handler to call when a SIGINT (Ctrl+C) is received.

func InterruptRequested

func InterruptRequested() bool

InterruptRequested returns true when the channel returned by interruptListener was closed. This simplifies early shutdown slightly since the caller can just use an if statement instead of a select.

func SimulateInterrupt

func SimulateInterrupt()

SimulateInterrupt requests invoking the clean termination process by an internal component instead of a SIGINT.

Types

This section is empty.

Jump to

Keyboard shortcuts

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