Documentation ¶
Index ¶
Constants ¶
View Source
const ( ErrorsFuncEventAlreadyExists = "注册函数类事件失败,键名已经被注册" ErrorsFuncEventNotRegister = "没有找到键名对应的函数" ShutdownHookerPrefix = "graceful_shutdown_hooker_" )
Variables ¶
This section is empty.
Functions ¶
func CreateEventManage ¶
func CreateEventManage(prefix string) *eventManage
CreateEventManage 创建一个事件管理工厂
func RegisterShutdownHooker ¶
RegisterShutdownHooker 注册优雅停机钩子事件
func RegisterShutdownHookerAddChan ¶
RegisterShutdownHookerAddChan 注册优雅停机钩子事件,并额外返回一个取消信号 当执行优雅停机时,events 会先被执行,然后发送信号给通道
Types ¶
Click to show internal directories.
Click to hide internal directories.