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 }
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() }
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") }