예제 #1
0
파일: timer.go 프로젝트: zwczou/goserver
func (tm *TimerMgr) Start() {
	logger.Trace("Timer Start")
	defer logger.Trace("Timer Start [ok]")

	tm.Object = basic.NewObject(core.ObjId_TimerId,
		"timer",
		Config.Options,
		tm)
	tm.UserData = tm

	core.LaunchChild(TimerModule.Object)
}
예제 #2
0
파일: executor.go 프로젝트: zwczou/goserver
func (e *Executor) Start() {
	logger.Trace("Executor Start")
	defer logger.Trace("Executor Start [ok]")

	e.Object = basic.NewObject(core.ObjId_ExecutorId,
		"executor",
		Config.Options,
		nil)
	e.c.NumberOfReplicas = WorkerVirtualNum
	e.UserData = e
	e.AddWorker(Config.Worker.WorkerCnt)

	core.LaunchChild(TaskExecutor.Object)
}
예제 #3
0
func (this *ModuleMgr) Start() *utils.Waitor {
	logger.Trace("Startup PreloadModules")
	for e := this.preloadModule.Front(); e != nil; e = e.Next() {
		if me, ok := e.Value.(*PreloadModuleEntity); ok {
			me.module.Start()
		}
	}
	logger.Trace("Startup PreloadModules [ok]")

	this.Object = basic.NewObject(core.ObjId_CoreId,
		"core",
		Config.Options,
		this)
	this.UserData = this
	core.LaunchChild(this.Object)

	this.state = ModuleStateInit
	//给模块预留调度的空间,防止主线程直接跑过去
	select {
	case <-time.After(time.Second):
	}
	return this.Object.Waitor
}