shutdown

package
v0.0.0-...-e457aa1 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2021 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddListener

func AddListener(listener ShutdownListener)

AddListener is used to append the input ShutdownListener to the internal list which will be used for notification.

func Wait

func Wait()

Wait Blocks the calling thread and waits till the shutdown notification is received

Types

type ShutdownHandler

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

ShutdownHandler is responsible for listening to shutdown notifications and propagate the same

func GetShutdownHandler

func GetShutdownHandler() *ShutdownHandler

GetShutdownHandler can be invoked from other packages for fetching an instance of the ShutdownHandler

func (*ShutdownHandler) Init

func (shutdownHandler *ShutdownHandler) Init(logger *glog.Logger)

Init initializes the ShutdownHandler Don't set logger if you want to log to the terminal - shutdown.GetShutdownHandler().Init(nil)

type ShutdownListener

type ShutdownListener interface {
	HandleShutdown()
}

ShutdownListener should be implemented by structs which needs shutdown notification

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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