From eb1867c5fd3dc24ce67406cdacd48d29a4306233 Mon Sep 17 00:00:00 2001 From: orgin Date: Wed, 29 Jun 2022 11:15:22 +0800 Subject: [PATCH] =?UTF-8?q?=E6=89=A9=E5=B1=95IService=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- service/service.go | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/service/service.go b/service/service.go index 60566ad..0436302 100644 --- a/service/service.go +++ b/service/service.go @@ -22,18 +22,24 @@ var timerDispatcherLen = 100000 type IService interface { Init(iService IService,getClientFun rpc.FuncRpcClient,getServerFun rpc.FuncRpcServer,serviceCfg interface{}) - SetName(serviceName string) - GetName() string + Wait() + Start() + OnSetup(iService IService) OnInit() error OnStart() OnRelease() - Wait() - Start() + + SetName(serviceName string) + GetName() string GetRpcHandler() rpc.IRpcHandler GetServiceCfg()interface{} - OpenProfiler() GetProfiler() *profiler.Profiler + GetServiceEventChannelNum() int + GetServiceTimerChannelNum() int + + SetEventChannelNum(num int) + OpenProfiler() } // eventPool的内存池,缓存Event @@ -318,7 +324,7 @@ func (s *Service) GetServiceEventChannelNum() int{ return len(s.chanEvent) } -func (s *Service) GetServiceTimerChannel() int{ +func (s *Service) GetServiceTimerChannelNum() int{ return len(s.dispatcher.ChanTimer) }