Documentation ¶
Index ¶
- Constants
- func Init()
- func SetMaxServiceChannel(maxEventChannel int)
- func Setup(s IService) bool
- func Start()
- func StopAllService()
- type DiscoveryServiceEvent
- type IModule
- type IModuleTimer
- type IService
- type Module
- func (m *Module) AddModule(module IModule) (uint32, error)
- func (m *Module) AfterFunc(d time.Duration, cb func(*timer.Timer)) *timer.Timer
- func (m *Module) CancelTimerId(timerId *uint64) bool
- func (m *Module) CronFunc(cronExpr *timer.CronExpr, cb func(*timer.Cron)) *timer.Cron
- func (m *Module) GenTimerId() uint64
- func (m *Module) GetAncestor() IModule
- func (m *Module) GetEventHandler() event.IEventHandler
- func (m *Module) GetEventProcessor() event.IEventProcessor
- func (m *Module) GetModule(moduleId uint32) IModule
- func (m *Module) GetModuleId() uint32
- func (m *Module) GetModuleName() string
- func (m *Module) GetParent() IModule
- func (m *Module) GetService() IService
- func (m *Module) NewModuleId() uint32
- func (m *Module) NewTicker(d time.Duration, cb func(*timer.Ticker)) *timer.Ticker
- func (m *Module) NotifyEvent(ev event.IEvent)
- func (m *Module) OnAddTimer(t timer.ITimer)
- func (m *Module) OnCloseTimer(t timer.ITimer)
- func (m *Module) OnInit() error
- func (m *Module) OnRelease()
- func (m *Module) ReleaseModule(moduleId uint32)
- func (m *Module) SafeAfterFunc(timerId *uint64, d time.Duration, AdditionData interface{}, ...)
- func (m *Module) SafeCronFunc(cronId *uint64, cronExpr *timer.CronExpr, AdditionData interface{}, ...)
- func (m *Module) SafeNewTicker(tickerId *uint64, d time.Duration, AdditionData interface{}, ...)
- func (m *Module) SetModuleId(moduleId uint32) bool
- type RegDiscoveryServiceEventFunType
- type RegRpcEventFunType
- type RpcConnEvent
- type Service
- func (s *Service) GetName() string
- func (s *Service) GetProfiler() *profiler.Profiler
- func (s *Service) GetServiceCfg() interface{}
- func (s *Service) GetServiceEventChannelNum() int
- func (s *Service) GetServiceTimerChannelNum() int
- func (s *Service) Init(iService IService, getClientFun rpc.FuncRpcClient, ...)
- func (s *Service) IsSingleCoroutine() bool
- func (s *Service) OnDiscoverServiceEvent(ev event.IEvent)
- func (s *Service) OnInit() error
- func (s *Service) OnNodeEvent(ev event.IEvent)
- func (s *Service) OnRelease()
- func (s *Service) OnSetup(iService IService)
- func (s *Service) OnStart()
- func (s *Service) OpenProfiler()
- func (s *Service) PushEvent(ev event.IEvent) error
- func (s *Service) PushRpcRequest(rpcRequest *rpc.RpcRequest) error
- func (s *Service) PushRpcResponse(call *rpc.Call) error
- func (s *Service) RegDiscoverListener(discoveryServiceListener rpc.IDiscoveryServiceListener)
- func (s *Service) RegEventReceiverFunc(eventType event.EventType, receiver event.IEventHandler, ...)
- func (s *Service) RegRawRpc(rpcMethodId uint32, rawRpcCB rpc.RawRpcCallBack)
- func (s *Service) RegRpcListener(rpcEventLister rpc.INodeListener)
- func (s *Service) Release()
- func (s *Service) Run()
- func (s *Service) SetEventChannelNum(num int)
- func (s *Service) SetGoRoutineNum(goroutineNum int32) bool
- func (s *Service) SetName(serviceName string)
- func (s *Service) Start()
- func (s *Service) Stop()
- func (s *Service) UnRegDiscoverListener(rpcLister rpc.INodeListener)
- func (s *Service) UnRegEventReceiverFunc(eventType event.EventType, receiver event.IEventHandler)
- func (s *Service) UnRegRpcListener(rpcLister rpc.INodeListener)
Constants ¶
View Source
const InitModuleId = 1e9
Variables ¶
This section is empty.
Functions ¶
func SetMaxServiceChannel ¶
func SetMaxServiceChannel(maxEventChannel int)
func StopAllService ¶
func StopAllService()
Types ¶
type DiscoveryServiceEvent ¶
DiscoveryServiceEvent 发现服务结点
func (*DiscoveryServiceEvent) GetEventType ¶
func (rpcEventData *DiscoveryServiceEvent) GetEventType() event.EventType
type IModule ¶
type IModule interface { concurrent.IConcurrent SetModuleId(moduleId uint32) bool GetModuleId() uint32 AddModule(module IModule) (uint32, error) GetModule(moduleId uint32) IModule GetAncestor() IModule ReleaseModule(moduleId uint32) NewModuleId() uint32 GetParent() IModule OnInit() error OnRelease() GetService() IService GetModuleName() string GetEventProcessor() event.IEventProcessor NotifyEvent(ev event.IEvent) // contains filtered or unexported methods }
type IModuleTimer ¶
type IService ¶
type IService interface { concurrent.IConcurrent Init(iService IService, getClientFun rpc.FuncRpcClient, getServerFun rpc.FuncRpcServer, serviceCfg interface{}) Stop() Start() OnSetup(iService IService) OnInit() error OnStart() OnRelease() SetName(serviceName string) GetName() string GetRpcHandler() rpc.IRpcHandler GetServiceCfg() interface{} GetProfiler() *profiler.Profiler GetServiceEventChannelNum() int GetServiceTimerChannelNum() int SetEventChannelNum(num int) OpenProfiler() }
func GetService ¶
type Module ¶
type Module struct { rpcHandle.IRpcHandler concurrent.IConcurrent // contains filtered or unexported fields }
func (*Module) CancelTimerId ¶
func (*Module) GenTimerId ¶
func (*Module) GetAncestor ¶
func (*Module) GetEventHandler ¶
func (m *Module) GetEventHandler() event.IEventHandler
func (*Module) GetEventProcessor ¶
func (m *Module) GetEventProcessor() event.IEventProcessor
func (*Module) GetModuleId ¶
func (*Module) GetModuleName ¶
func (*Module) GetService ¶
func (*Module) NewModuleId ¶
func (*Module) NotifyEvent ¶
func (*Module) OnAddTimer ¶
func (*Module) OnCloseTimer ¶
func (*Module) ReleaseModule ¶
func (*Module) SafeAfterFunc ¶
func (*Module) SafeCronFunc ¶
func (*Module) SafeNewTicker ¶
func (*Module) SetModuleId ¶
type RegDiscoveryServiceEventFunType ¶
type RegDiscoveryServiceEventFunType func(serviceName string)
var RegDiscoveryServiceEventFun RegDiscoveryServiceEventFunType
var UnRegDiscoveryServiceEventFun RegDiscoveryServiceEventFunType
type RegRpcEventFunType ¶
type RegRpcEventFunType func(serviceName string)
var RegRpcEventFun RegRpcEventFunType
var UnRegRpcEventFun RegRpcEventFunType
type RpcConnEvent ¶
RpcConnEvent Node结点连接事件
func (*RpcConnEvent) GetEventType ¶
func (rpcEventData *RpcConnEvent) GetEventType() event.EventType
type Service ¶
type Service struct { Module // contains filtered or unexported fields }
func (*Service) GetProfiler ¶
func (*Service) GetServiceCfg ¶
func (s *Service) GetServiceCfg() interface{}
func (*Service) GetServiceEventChannelNum ¶
func (*Service) GetServiceTimerChannelNum ¶
func (*Service) Init ¶
func (s *Service) Init(iService IService, getClientFun rpc.FuncRpcClient, getServerFun rpc.FuncRpcServer, serviceCfg interface{})
func (*Service) IsSingleCoroutine ¶
func (*Service) OnDiscoverServiceEvent ¶
func (*Service) OnNodeEvent ¶
func (*Service) OpenProfiler ¶
func (s *Service) OpenProfiler()
func (*Service) PushRpcRequest ¶
func (s *Service) PushRpcRequest(rpcRequest *rpc.RpcRequest) error
func (*Service) RegDiscoverListener ¶
func (s *Service) RegDiscoverListener(discoveryServiceListener rpc.IDiscoveryServiceListener)
func (*Service) RegEventReceiverFunc ¶
func (s *Service) RegEventReceiverFunc(eventType event.EventType, receiver event.IEventHandler, callback event.EventCallBack)
func (*Service) RegRawRpc ¶
func (s *Service) RegRawRpc(rpcMethodId uint32, rawRpcCB rpc.RawRpcCallBack)
func (*Service) RegRpcListener ¶
func (s *Service) RegRpcListener(rpcEventLister rpc.INodeListener)
func (*Service) SetEventChannelNum ¶
func (*Service) SetGoRoutineNum ¶
func (*Service) UnRegDiscoverListener ¶
func (s *Service) UnRegDiscoverListener(rpcLister rpc.INodeListener)
func (*Service) UnRegEventReceiverFunc ¶
func (s *Service) UnRegEventReceiverFunc(eventType event.EventType, receiver event.IEventHandler)
func (*Service) UnRegRpcListener ¶
func (s *Service) UnRegRpcListener(rpcLister rpc.INodeListener)
Click to show internal directories.
Click to hide internal directories.