Exemple #1
0
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
}
Exemple #2
0
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()
}
Exemple #3
0
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")
}