Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetContextWithCancel ¶
func GetContextWithCancel() (context.Context, context.CancelFunc)
GetContextWithCancel 创建一个新的可取消上下文
func RegisterHook ¶
RegisterHook 注册系统退出的hook
func WaitForShutdown ¶
func WaitForShutdown(d ...int)
WaitForShutdown 阻塞等待关闭信号
参数d为等待的毫秒数:
- 如果传入d > 0,等待指定毫秒后关闭
- 如果传入d == 0或未传参,等待中断信号
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.