模块支持rpc调用

This commit is contained in:
boyce
2020-12-18 16:36:14 +08:00
parent 20626c8c65
commit 8da32be256
2 changed files with 6 additions and 3 deletions

View File

@@ -4,6 +4,7 @@ import (
"fmt"
"github.com/duanhf2012/origin/event"
"github.com/duanhf2012/origin/log"
rpcHandle "github.com/duanhf2012/origin/rpc"
"github.com/duanhf2012/origin/util/timer"
"reflect"
"time"
@@ -31,6 +32,7 @@ type IModule interface {
//1.管理各模块树层关系
//2.提供定时器常用工具
type Module struct {
rpcHandle.IRpcHandler
moduleId int64 //模块Id
moduleName string //模块名称
parent IModule //父亲
@@ -86,7 +88,7 @@ func (m *Module) AddModule(module IModule) (int64,error){
if ok == true {
return 0,fmt.Errorf("Exists module id %d",module.GetModuleId())
}
pAddModule.IRpcHandler = m.IRpcHandler
pAddModule.self = module
pAddModule.parent = m.self
pAddModule.dispatcher = m.GetAncestor().getBaseModule().(*Module).dispatcher