signalwait

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2022 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrSignal = errors.New("received signal")

ErrSignal is wrapped by the errors returned by WaitFunc when a signal has been received.

Functions

This section is empty.

Types

type WaitFunc

type WaitFunc func(context.Context) error

WaitFunc is the type of functions waiting for signals.

func Setup

func Setup(signals ...os.Signal) (wait WaitFunc, stop context.CancelFunc)

Setup starts relaying incoming signals into an internal buffer. The returned wait function sleeps until either a signal has been received (which may have happened before the wait function is called) or the wait function's context is canceled. The stop function causes signals to not be captured anymore.

Jump to

Keyboard shortcuts

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