示例#1
0
文件: server.go 项目: postfix/golib-1
func (this *Server) Launch() *Server {
	this.StartedAt = time.Now()
	this.hostname, _ = os.Hostname()
	this.pid = os.Getpid()
	signal.IgnoreSignal(syscall.SIGHUP, syscall.SIGQUIT, syscall.SIGSTOP)
	runtime.GOMAXPROCS(this.Int("max_cpu", runtime.NumCPU()))
	return this
}
示例#2
0
文件: serve.go 项目: jlyt898/fae
func (this *Engine) ServeForever() {
	this.StartedAt = time.Now()
	this.hostname, _ = os.Hostname()
	this.pid = os.Getpid()

	signal.IgnoreSignal(syscall.SIGHUP)

	this.launchHttpServ()
	defer this.stopHttpServ()

	<-this.launchRpcServe()
}
示例#3
0
文件: launch.go 项目: justinblah/fae
func (this *Engine) ServeForever() {
	this.StartedAt = time.Now()
	this.hostname, _ = os.Hostname()
	this.pid = os.Getpid()

	signal.IgnoreSignal(syscall.SIGHUP)

	log.Info("Launching Engine...")

	// start the stats counter
	this.stats.Start(this.StartedAt)

	this.launchHttpServ()
	defer this.stopHttpServ()

	if err := this.peer.Start(); err != nil {
		log.Error(err)
	}

	<-this.launchRpcServe()

	log.Info("Engine terminated")
}