Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Default ¶
type Default[KEY ISubPubKey] struct { // contains filtered or unexported fields }
Default 发布订阅器
func NewDefault ¶
func NewDefault[KEY ISubPubKey]() *Default[KEY]
func (*Default[KEY]) Subscribe ¶
func (p *Default[KEY]) Subscribe(key KEY, onFunction xcontrol.OnFunction) error
Subscribe 订阅
[❗] 订阅的回调函数, 不可以是闭包函数.
func (*Default[KEY]) Unsubscribe ¶
func (p *Default[KEY]) Unsubscribe(key KEY, onFunction xcontrol.OnFunction) error
Unsubscribe
[❗] 取消订阅的回调函数, 不可以是闭包函数.
type IPublish ¶
type IPublish[KEY ISubPubKey] interface { Publish(key KEY, args ...any) error // 发布 }
type ISubscribe ¶
type ISubscribe[KEY ISubPubKey] interface { Subscribe(key KEY, onFunction xcontrol.OnFunction) error // 订阅 Unsubscribe(key KEY, onFunction xcontrol.OnFunction) error // 取消订阅 }
Click to show internal directories.
Click to hide internal directories.