graceful

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2018 License: MIT Imports: 3 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Shutdown

func Shutdown(hosted Graceful) error

Shutdown starts an hosted process and responds to SIGINT and SIGTERM to shut the app down. It will return any errors returned by app.Start() that are not caused by shutting down the server.

func ShutdownBySignal

func ShutdownBySignal(hosted Graceful, terminateSignal chan os.Signal) error

ShutdownBySignal gracefully stops a hosted process based on an os signal channel.

Types

type Graceful

type Graceful interface {
	Start() error
	Stop() error
	NotifyStarted() <-chan struct{}
	NotifyStopped() <-chan struct{}
}

Graceful is a server that can start and shutdown.

Jump to

Keyboard shortcuts

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