signalKit

package
v2.8.159 Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MonitorExitSignal

func MonitorExitSignal()

MonitorExitSignal 监听退出信号(拦截关闭信号).

可以参考 go-zero 中的 "proc/signals.go".

PS: (1) 无法拦截部分信号(e.g. syscall.SIGSTOP、syscall.SIGKILL); (2) 可以通过 logrus.RegisterExitHandler() 在程序退出前"毁尸灭迹"(在里面你甚至可以 time.Sleep); (3) 此函数对 主动调用os.Exit() 无效.

Types

This section is empty.

Jump to

Keyboard shortcuts

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