Documentation ¶
Index ¶
- type Eventbus
- func (eb *Eventbus) Close() error
- func (eb *Eventbus) Publish(ctx context.Context, topic string, payload interface{}) error
- func (eb *Eventbus) Subscribe(ctx context.Context, topic string, handler eventbus.EventHandler) error
- func (eb *Eventbus) Unsubscribe(ctx context.Context, topic string, handler eventbus.EventHandler) error
- type Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Eventbus ¶
type Eventbus struct {
// contains filtered or unexported fields
}
func NewEventbus ¶
func (*Eventbus) Subscribe ¶
func (eb *Eventbus) Subscribe(ctx context.Context, topic string, handler eventbus.EventHandler) error
Subscribe 订阅事件
func (*Eventbus) Unsubscribe ¶
func (eb *Eventbus) Unsubscribe(ctx context.Context, topic string, handler eventbus.EventHandler) error
Unsubscribe 取消订阅
Click to show internal directories.
Click to hide internal directories.