协议网关、消息队列和流处理函数
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
614 B

//go:build windows
// +build windows
package hpds_node
import (
"git.hpds.cc/Component/network/log"
)
// initialize when mq running as server. support inspection:
// - `kill -SIGTERM <pid>` graceful shutdown
func (z *messageQueue) init() {
go func() {
c := make(chan os.Signal, 1)
signal.Notify(c, syscall.SIGTERM, syscall.SIGINT)
log.Infof("%s Listening SIGTERM/SIGINT...", mqLogPrefix)
for p1 := range c {
log.Printf("Received signal: %s", p1)
if p1 == syscall.SIGTERM || p1 == syscall.SIGINT {
log.Infof("%s graceful shutting down ... %s", mqLogPrefix, p1)
os.Exit(0)
}
}
}()
}