本文整理汇总了Golang中github.com/burke/zeus/go/processtree.ProcessTree.RestartNodesWithFeature方法的典型用法代码示例。如果您正苦于以下问题:Golang ProcessTree.RestartNodesWithFeature方法的具体用法?Golang ProcessTree.RestartNodesWithFeature怎么用?Golang ProcessTree.RestartNodesWithFeature使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/burke/zeus/go/processtree.ProcessTree
的用法示例。
在下文中一共展示了ProcessTree.RestartNodesWithFeature方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: doRun
func doRun() int {
slog.Colorized("{green}Starting {yellow}Z{red}e{blue}u{magenta}s{green} server")
zerror.Init()
var tree *processtree.ProcessTree = config.BuildProcessTree()
done := make(chan bool)
// Start processes and register them for exit when the function returns.
filesChanged, filemonitorDone := filemonitor.Start(done)
defer exit(processtree.StartSlaveMonitor(tree, done), done)
defer exit(clienthandler.Start(tree, done), done)
defer exit(filemonitorDone, done)
defer slog.Suppress()
defer zerror.PrintFinalOutput()
defer exit(statuschart.Start(tree, done), done)
c := make(chan os.Signal, 1)
signal.Notify(c, terminatingSignals...)
for {
select {
case sig := <-c:
if sig == syscall.SIGINT {
return 0
} else {
return 1
}
case changed := <-filesChanged:
go tree.RestartNodesWithFeature(changed)
}
}
return -1 // satisfy the compiler
}