Documentation
¶
Index ¶
- func NewEventBusByRedis(client *redis.Client) (eventbus.EventBus, error)
- type PubSub
- func (r *PubSub) HandleCount(topic string) int
- func (r *PubSub) Publish(ctx context.Context, topic string, msg *eventbus.Message) (err error)
- func (r *PubSub) Subscribe(ctx context.Context, topic string, handle eventbus.SubscribeHandler) (err error)
- func (r *PubSub) SubscribeOnce(ctx context.Context, topic string, handle eventbus.SubscribeHandler) (err error)
- func (r *PubSub) Unsubscribe(ctx context.Context, topic string, handle eventbus.SubscribeHandler) (err error)
- type Stream
- func (r *Stream) HandleCount(topic string) int
- func (r *Stream) Publish(ctx context.Context, topic string, msg *eventbus.Message) (err error)
- func (r *Stream) Subscribe(ctx context.Context, topic string, handle eventbus.SubscribeHandler) (err error)
- func (r *Stream) SubscribeOnce(ctx context.Context, topic string, handle eventbus.SubscribeHandler) (err error)
- func (r *Stream) Unsubscribe(ctx context.Context, topic string, handle eventbus.SubscribeHandler) (err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewEventBusByRedis ¶
func NewEventBusByRedis(client *redis.Client) (eventbus.EventBus, error)
NewEventBusByRedis 初始化基于 Redis 的事件中心
Types ¶
type PubSub ¶
type PubSub struct {
// contains filtered or unexported fields
}
func (*PubSub) HandleCount ¶
func (*PubSub) SubscribeOnce ¶
type Stream ¶
type Stream struct {
// contains filtered or unexported fields
}
func (*Stream) HandleCount ¶
func (*Stream) SubscribeOnce ¶
Click to show internal directories.
Click to hide internal directories.