优化函数命名

This commit is contained in:
boyce
2021-04-29 17:33:13 +08:00
parent a60ad1cccf
commit 6757eedc48
2 changed files with 4 additions and 4 deletions

View File

@@ -52,7 +52,7 @@ func (ds *DynamicDiscoveryMaster) addNodeInfo(nodeInfo *rpc.NodeInfo){
func (ds *DynamicDiscoveryMaster) OnInit() error{ func (ds *DynamicDiscoveryMaster) OnInit() error{
ds.mapNodeInfo = make(map[int32] *rpc.NodeInfo,20) ds.mapNodeInfo = make(map[int32] *rpc.NodeInfo,20)
ds.RegisterRpcListener(ds) ds.RegRpcListener(ds)
return nil return nil
} }
@@ -126,7 +126,7 @@ func (ds *DynamicDiscoveryMaster) RPC_RegServiceDiscover(req *rpc.ServiceDiscove
} }
func (dc *DynamicDiscoveryClient) OnInit() error{ func (dc *DynamicDiscoveryClient) OnInit() error{
dc.RegisterRpcListener(dc) dc.RegRpcListener(dc)
return nil return nil
} }

View File

@@ -237,13 +237,13 @@ func (s *Service) OnRpcEvent(ev event.IEvent){
} }
} }
func (s *Service) RegisterRpcListener (rpcEventLister rpc.IRpcListener) { func (s *Service) RegRpcListener(rpcEventLister rpc.IRpcListener) {
s.rpcEventLister = rpcEventLister s.rpcEventLister = rpcEventLister
s.RegEventReceiverFunc(event.Sys_Event_Rpc_Event,s.GetEventHandler(),s.OnRpcEvent) s.RegEventReceiverFunc(event.Sys_Event_Rpc_Event,s.GetEventHandler(),s.OnRpcEvent)
RegRpcEventFun(s.GetName()) RegRpcEventFun(s.GetName())
} }
func (s *Service) UnRegisterRpcListener (rpcLister rpc.IRpcListener) { func (s *Service) UnRegRpcListener(rpcLister rpc.IRpcListener) {
s.UnRegEventReceiverFunc(event.Sys_Event_Rpc_Event,s.GetEventHandler()) s.UnRegEventReceiverFunc(event.Sys_Event_Rpc_Event,s.GetEventHandler())
RegRpcEventFun(s.GetName()) RegRpcEventFun(s.GetName())
} }