Documentation
¶
Overview ¶
Package event 提供了一个事件管理器,用于处理异步事件 使用 channel 作为事件通道 优点: 简单, 性能好 缺点: 需要预估事件通道容量, 如果容量不够, 会导致事件丢失
Package event 提供了一个事件管理器,用于处理异步事件 使用 list.List 作为事件通道 优点: 不需要预估事件通道容量, 不会丢失事件 缺点: 性能不如 channel
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChanManager ¶
type ChanManager struct {
// contains filtered or unexported fields
}
ChanManager 事件管理器
func NewChanManager ¶
func NewChanManager(workerCount uint32, onFunction xcontrol.OnFunction, eventChanCapacity uint32) *ChanManager
NewChanManager 创建一个新的事件管理器
workerCount: 工作协程数量 handler: 事件处理函数 eventChanCapacity: 事件 chan 容量
func (*ChanManager) Event ¶
func (p *ChanManager) Event(sb xcontrol.ISwitchButton, cb xcontrol.ICallBack)
type ListMgr ¶
type ListMgr struct {
// contains filtered or unexported fields
}
ListMgr 事件管理器
func NewListMgr ¶
func NewListMgr(workerCount uint32, onFunction xcontrol.OnFunction) *ListMgr
NewListMgr 创建一个新的事件管理器
workerCount: 工作协程数量 handler: 事件处理函数
Click to show internal directories.
Click to hide internal directories.