Documentation ¶
Index ¶
- func DeleteEvent(event IEvent)
- func SetEventPoolSize(eventPoolSize int)
- type Event
- type EventCallBack
- type EventHandler
- type EventProcessor
- func (processor *EventProcessor) EventHandler(ev IEvent)
- func (processor *EventProcessor) Init(eventChannel IEventChannel)
- func (processor *EventProcessor) RegEventReceiverFunc(eventType EventType, receiver IEventHandler, callback EventCallBack)
- func (processor *EventProcessor) UnRegEventReceiverFun(eventType EventType, receiver IEventHandler)
- type EventType
- type IEvent
- type IEventChannel
- type IEventHandler
- type IEventProcessor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeleteEvent ¶
func DeleteEvent(event IEvent)
func SetEventPoolSize ¶
func SetEventPoolSize(eventPoolSize int)
Types ¶
type Event ¶
type Event struct { Type EventType Data interface{} IntExt [2]int64 StringExt [2]string AnyExt [2]any // contains filtered or unexported fields }
func (*Event) GetEventType ¶
type EventHandler ¶
type EventHandler struct {
// contains filtered or unexported fields
}
func (*EventHandler) Destroy ¶
func (handler *EventHandler) Destroy()
func (*EventHandler) GetEventProcessor ¶
func (handler *EventHandler) GetEventProcessor() IEventProcessor
func (*EventHandler) Init ¶
func (handler *EventHandler) Init(processor IEventProcessor)
func (*EventHandler) NotifyEvent ¶
func (handler *EventHandler) NotifyEvent(ev IEvent)
type EventProcessor ¶
type EventProcessor struct { IEventChannel // contains filtered or unexported fields }
func (*EventProcessor) EventHandler ¶
func (processor *EventProcessor) EventHandler(ev IEvent)
func (*EventProcessor) Init ¶
func (processor *EventProcessor) Init(eventChannel IEventChannel)
func (*EventProcessor) RegEventReceiverFunc ¶
func (processor *EventProcessor) RegEventReceiverFunc(eventType EventType, receiver IEventHandler, callback EventCallBack)
func (*EventProcessor) UnRegEventReceiverFun ¶
func (processor *EventProcessor) UnRegEventReceiverFun(eventType EventType, receiver IEventHandler)
type EventType ¶
type EventType int
const ( ServiceRpcRequestEvent EventType = -1 ServiceRpcResponseEvent EventType = -2 Sys_Event_Tcp EventType = -3 Sys_Event_Http_Event EventType = -4 Sys_Event_WebSocket EventType = -5 Sys_Event_Kcp EventType = -6 Sys_Event_Node_Conn_Event EventType = -7 Sys_Event_Nats_Conn_Event EventType = -8 Sys_Event_DiscoverService EventType = -9 Sys_Event_Retire EventType = -10 Sys_Event_EtcdDiscovery EventType = -11 Sys_Event_Gin_Event EventType = -12 Sys_Event_FrameTick EventType = -13 Sys_Event_User_Define EventType = 1 )
大于Sys_Event_User_Define给用户定义
type IEventChannel ¶
type IEventHandler ¶
type IEventHandler interface { Init(processor IEventProcessor) GetEventProcessor() IEventProcessor //获得事件 NotifyEvent(IEvent) Destroy() // contains filtered or unexported methods }
func NewEventHandler ¶
func NewEventHandler() IEventHandler
type IEventProcessor ¶
type IEventProcessor interface { IEventChannel Init(eventChannel IEventChannel) EventHandler(ev IEvent) RegEventReceiverFunc(eventType EventType, receiver IEventHandler, callback EventCallBack) UnRegEventReceiverFun(eventType EventType, receiver IEventHandler) // contains filtered or unexported methods }
func NewEventProcessor ¶
func NewEventProcessor() IEventProcessor
Click to show internal directories.
Click to hide internal directories.