graceful_shutdown

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ShutdownSignals receives shutdown signals to process
	ShutdownSignals = []os.Signal{
		os.Interrupt, os.Kill, syscall.SIGKILL, syscall.SIGSTOP,
		syscall.SIGHUP, syscall.SIGINT, syscall.SIGQUIT, syscall.SIGILL, syscall.SIGTRAP,
		syscall.SIGABRT, syscall.SIGSYS, syscall.SIGTERM,
	}

	// DumpHeapShutdownSignals receives shutdown signals to process
	DumpHeapShutdownSignals = []os.Signal{
		syscall.SIGQUIT, syscall.SIGILL,
		syscall.SIGTRAP, syscall.SIGABRT, syscall.SIGSYS,
	}
)

Functions

func Init

func Init(opts ...Option)

func RegisterProtocol

func RegisterProtocol(name string)

RegisterProtocol registers protocol which would be destroyed before shutdown. Please make sure that Init function has been invoked before, otherwise this function would not make any sense.

Types

type Option

type Option func(*Options)

func SetShutdown_Config

func SetShutdown_Config(cfg *global.ShutdownConfig) Option

func WithConsumerUpdateWaitTime

func WithConsumerUpdateWaitTime(duration time.Duration) Option

func WithOfflineRequestWindowTimeout

func WithOfflineRequestWindowTimeout(timeout time.Duration) Option

func WithRejectRequest

func WithRejectRequest() Option

func WithStepTimeout

func WithStepTimeout(timeout time.Duration) Option

func WithTimeout

func WithTimeout(timeout time.Duration) Option

func WithoutInternalSignal

func WithoutInternalSignal() Option

type Options

type Options struct {
	Shutdown *global.ShutdownConfig
}

func NewOptions

func NewOptions(opts ...Option) *Options

Jump to

Keyboard shortcuts

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