From 7586221b80bc2d06182d7b64f73891c95583cf12 Mon Sep 17 00:00:00 2001 From: boyce Date: Sat, 19 Dec 2020 00:32:15 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AF=B9Module=E6=96=B0=E5=A2=9ERpc=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- rpc/rpchandler.go | 1 + service/module.go | 1 + service/service.go | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/rpc/rpchandler.go b/rpc/rpchandler.go index 2e4aef2..c99e791 100644 --- a/rpc/rpchandler.go +++ b/rpc/rpchandler.go @@ -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 } diff --git a/service/module.go b/service/module.go index 9fc38bb..3b24d80 100644 --- a/service/module.go +++ b/service/module.go @@ -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{ diff --git a/service/service.go b/service/service.go index 130a2ca..267a438 100644 --- a/service/service.go +++ b/service/service.go @@ -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)