graceful

package
v0.1.9 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const MinShutdownTimeout = 15 * time.Second

MinShutdownTimeout 最小停止超时时间

Variables

This section is empty.

Functions

This section is empty.

Types

type Graceful

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

func NewGraceful

func NewGraceful() *Graceful

func (*Graceful) AddInherited

func (that *Graceful) AddInherited(procFiles []*os.File, envs map[string]string)

AddInherited 添加需要给重启后新进程继承的文件句柄和环境变量

func (*Graceful) GraceSignal

func (that *Graceful) GraceSignal()

func (*Graceful) Reboot

func (that *Graceful) Reboot(timeout ...time.Duration)

Reboot 开启优雅的重启流程

func (*Graceful) SetShutdown

func (that *Graceful) SetShutdown(timeout time.Duration, firstSweepFunc, beforeExitingFunc func() error)

SetShutdown 设置退出的基本参数

func (*Graceful) Shutdown

func (that *Graceful) Shutdown(timeout ...time.Duration)

Shutdown 执行进程关闭任务

Jump to

Keyboard shortcuts

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