Beispiel #1
0
func (this *Engine) LoadConfigFile() *Engine {
	log.Info("Engine[%s] loading config file %s", BuildID, this.configFile)

	cf := new(engineConfig)
	var err error
	cf.Conf, err = conf.Load(this.configFile)
	if err != nil {
		panic(err)
	}

	this.conf = cf
	this.doLoadConfig()

	// RegisterHttpApi is ready
	this.setupHttpServ()

	// when config loaded, create the servants
	svr := servant.NewFunServant(config.Servants)
	this.rpcProcessor = rpc.NewFunServantProcessor(svr)
	svr.Start()

	this.peer = peer.NewPeer(this.conf.peerGroupAddr,
		this.conf.peerHeartbeatInterval, this.conf.peerDeadThreshold)

	return this
}
Beispiel #2
0
func (this *Engine) LoadConfigFile() *Engine {
	log.Debug("Loading config file %s", this.configFile)

	cf := new(engineConfig)
	var err error
	cf.Conf, err = conf.Load(this.configFile)
	if err != nil {
		panic(err)
	}

	this.conf = cf
	this.doLoadConfig()

	// RegisterHttpApi is ready
	this.setupHttpServ()

	// when config loaded, create the servants
	this.rpcProcessor = rpc.NewFunServantProcessor(servant.NewFunServant(config.Servants))

	return this
}