signal

package
v0.13.3-beta Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DisableLog

func DisableLog()

DisableLog disables all library log output. Logging output is disabled by default until UseLogger is called.

func UseLogger

func UseLogger(logger btclog.Logger)

UseLogger uses a specified Logger to output package logging info. This should be used in preference to SetLogWriter if the caller is also using btclog.

Types

type Interceptor

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

Interceptor contains channels and methods regarding application shutdown and interrupt signals

func Intercept

func Intercept() (Interceptor, error)

Intercept starts the interception of interrupt signals and returns an `Interceptor` instance. Note that any previous active interceptor must be stopped before a new one can be created

func (*Interceptor) Alive

func (c *Interceptor) Alive() bool

Alive returns true if the main interrupt handler has not been killed.

func (*Interceptor) Listening

func (c *Interceptor) Listening() bool

Listening returns true if the main interrupt handler has been started, and has not been killed.

func (*Interceptor) RequestShutdown

func (c *Interceptor) RequestShutdown()

RequestShutdown initiates a graceful shutdown from the application.

func (*Interceptor) ShutdownChannel

func (c *Interceptor) ShutdownChannel() <-chan struct{}

ShutdownChannel returns the channel that will be closed once the main interrupt handler has exited.

Jump to

Keyboard shortcuts

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