signal

package
v0.13.3 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2024 License: ISC Imports: 4 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

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

ShutdownRequestChannel is used to initiate shutdown from one of the subsystems using the same code paths as when an interrupt signal is received.

Functions

func InterruptListener

func InterruptListener() chan struct{}

InterruptListener listens for OS Signals such as SIGINT (Ctrl+C) and shutdown requests from shutdownRequestChannel. It returns a channel that is closed when either signal is received.

func InterruptRequested

func InterruptRequested(interrupted <-chan struct{}) 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.

Types

This section is empty.

Jump to

Keyboard shortcuts

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