Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EventBus ¶
type EventBus interface {
// Subscribe to a topic
Subscribe(ctx context.Context, topic string, handle SubscribeHandler) (err error)
// Unsubscribe to a topic
Unsubscribe(ctx context.Context, topic string, handle SubscribeHandler) (err error)
// SubscribeOnce subscribes to a topic once. Handler will be removed after executing
SubscribeOnce(ctx context.Context, topic string, handle SubscribeHandler) (err error)
// Publish post a message to the topic
Publish(ctx context.Context, topic string, msg *Message) (err error)
// HandleCount get the number of Handle subscriptions for a topic
HandleCount(topic string) int
}
EventBus event bus
type Message ¶
func (Message) MarshalBinary ¶
type SubscribeHandler ¶
type SubscribeHandler func(msg *Message)
Click to show internal directories.
Click to hide internal directories.