mirror of
https://github.com/duanhf2012/origin.git
synced 2026-02-04 06:54:45 +08:00
扩展IService新增接口
This commit is contained in:
@@ -22,18 +22,24 @@ var timerDispatcherLen = 100000
|
|||||||
|
|
||||||
type IService interface {
|
type IService interface {
|
||||||
Init(iService IService,getClientFun rpc.FuncRpcClient,getServerFun rpc.FuncRpcServer,serviceCfg interface{})
|
Init(iService IService,getClientFun rpc.FuncRpcClient,getServerFun rpc.FuncRpcServer,serviceCfg interface{})
|
||||||
SetName(serviceName string)
|
Wait()
|
||||||
GetName() string
|
Start()
|
||||||
|
|
||||||
OnSetup(iService IService)
|
OnSetup(iService IService)
|
||||||
OnInit() error
|
OnInit() error
|
||||||
OnStart()
|
OnStart()
|
||||||
OnRelease()
|
OnRelease()
|
||||||
Wait()
|
|
||||||
Start()
|
SetName(serviceName string)
|
||||||
|
GetName() string
|
||||||
GetRpcHandler() rpc.IRpcHandler
|
GetRpcHandler() rpc.IRpcHandler
|
||||||
GetServiceCfg()interface{}
|
GetServiceCfg()interface{}
|
||||||
OpenProfiler()
|
|
||||||
GetProfiler() *profiler.Profiler
|
GetProfiler() *profiler.Profiler
|
||||||
|
GetServiceEventChannelNum() int
|
||||||
|
GetServiceTimerChannelNum() int
|
||||||
|
|
||||||
|
SetEventChannelNum(num int)
|
||||||
|
OpenProfiler()
|
||||||
}
|
}
|
||||||
|
|
||||||
// eventPool的内存池,缓存Event
|
// eventPool的内存池,缓存Event
|
||||||
@@ -318,7 +324,7 @@ func (s *Service) GetServiceEventChannelNum() int{
|
|||||||
return len(s.chanEvent)
|
return len(s.chanEvent)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *Service) GetServiceTimerChannel() int{
|
func (s *Service) GetServiceTimerChannelNum() int{
|
||||||
return len(s.dispatcher.ChanTimer)
|
return len(s.dispatcher.ChanTimer)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user