mirror of
https://github.com/duanhf2012/origin.git
synced 2026-02-04 06:54:45 +08:00
对Module新增Rpc功能
This commit is contained in:
@@ -80,6 +80,7 @@ type IRpcHandler interface {
|
|||||||
CallNode(nodeId int,serviceMethod string,args interface{},reply interface{}) error
|
CallNode(nodeId int,serviceMethod string,args interface{},reply interface{}) error
|
||||||
GoNode(nodeId int,serviceMethod string,args interface{}) error
|
GoNode(nodeId int,serviceMethod string,args interface{}) error
|
||||||
RawGoNode(rpcProcessorType RpcProcessorType,nodeId int,serviceMethod string,args IRawInputArgs) error
|
RawGoNode(rpcProcessorType RpcProcessorType,nodeId int,serviceMethod string,args IRawInputArgs) error
|
||||||
|
CastGo(serviceMethod string,args interface{})
|
||||||
IsSingleCoroutine() bool
|
IsSingleCoroutine() bool
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -134,6 +134,7 @@ func (m *Module) ReleaseModule(moduleId int64){
|
|||||||
pModule.dispatcher = nil
|
pModule.dispatcher = nil
|
||||||
pModule.ancestor = nil
|
pModule.ancestor = nil
|
||||||
pModule.descendants = nil
|
pModule.descendants = nil
|
||||||
|
pModule.IRpcHandler = nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *Module) NewModuleId() int64{
|
func (m *Module) NewModuleId() int64{
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ func (s *Service) Init(iService IService,getClientFun rpc.FuncRpcClient,getServe
|
|||||||
s.dispatcher =timer.NewDispatcher(timerDispatcherLen)
|
s.dispatcher =timer.NewDispatcher(timerDispatcherLen)
|
||||||
|
|
||||||
s.rpcHandler.InitRpcHandler(iService.(rpc.IRpcHandler),getClientFun,getServerFun)
|
s.rpcHandler.InitRpcHandler(iService.(rpc.IRpcHandler),getClientFun,getServerFun)
|
||||||
s.IRpcHandler = s
|
s.IRpcHandler = &s.rpcHandler
|
||||||
s.self = iService.(IModule)
|
s.self = iService.(IModule)
|
||||||
//初始化祖先
|
//初始化祖先
|
||||||
s.ancestor = iService.(IModule)
|
s.ancestor = iService.(IModule)
|
||||||
|
|||||||
Reference in New Issue
Block a user