对Module新增Rpc功能

This commit is contained in:
boyce
2020-12-19 00:32:15 +08:00
parent dc0318af62
commit 7586221b80
3 changed files with 3 additions and 1 deletions

View File

@@ -80,6 +80,7 @@ type IRpcHandler interface {
CallNode(nodeId int,serviceMethod string,args interface{},reply interface{}) error
GoNode(nodeId int,serviceMethod string,args interface{}) error
RawGoNode(rpcProcessorType RpcProcessorType,nodeId int,serviceMethod string,args IRawInputArgs) error
CastGo(serviceMethod string,args interface{})
IsSingleCoroutine() bool
}

View File

@@ -134,6 +134,7 @@ func (m *Module) ReleaseModule(moduleId int64){
pModule.dispatcher = nil
pModule.ancestor = nil
pModule.descendants = nil
pModule.IRpcHandler = nil
}
func (m *Module) NewModuleId() int64{

View File

@@ -61,7 +61,7 @@ func (s *Service) Init(iService IService,getClientFun rpc.FuncRpcClient,getServe
s.dispatcher =timer.NewDispatcher(timerDispatcherLen)
s.rpcHandler.InitRpcHandler(iService.(rpc.IRpcHandler),getClientFun,getServerFun)
s.IRpcHandler = s
s.IRpcHandler = &s.rpcHandler
s.self = iService.(IModule)
//初始化祖先
s.ancestor = iService.(IModule)