graceful

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2024 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GraceSignal added in v0.1.1

func GraceSignal()

GraceSignal 监听信号

func Graceful

func Graceful() *graceful

Graceful 获取graceful对象

func IsChild added in v0.1.1

func IsChild() bool

IsChild 判断当前是否是子进程

func SetInheritListener added in v0.1.1

func SetInheritListener(address []InheritAddr) error

SetInheritListener 启动master worker模式的监听

func SetShutdown added in v0.1.1

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

SetShutdown 设置重启钩子

func Shutdown added in v0.1.1

func Shutdown(timeout ...time.Duration)

Shutdown 停止服务

Types

type GraceModel added in v0.1.1

type GraceModel int

GraceModel 平滑重启模型

const (
	// GraceChangeProcess 使用父子进程平滑重启
	GraceChangeProcess GraceModel = 1
	// GraceMasterWorker 使用master worker进程平滑重启
	GraceMasterWorker GraceModel = 2
)

func GetModel added in v0.1.1

func GetModel() GraceModel

GetModel 当前进程模型

type InheritAddr added in v0.1.1

type InheritAddr struct {
	Network   string
	Host      string
	Port      string
	TlsConfig *tls.Config
	// ghttp服务专用
	ServerName string
}

InheritAddr master进程需要监听的配置

Jump to

Keyboard shortcuts

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