Documentation ¶
Overview ¶
Package bus implements a message bus which is a common data model and a messaging infrastructure to allow different modules to communicate locally or remotely.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrTopicNotExist hints the topic published doesn't exist. ErrTopicNotExist = errors.New("the topic does not exist") )
Functions ¶
This section is empty.
Types ¶
type Bus ¶
type Bus struct {
// contains filtered or unexported fields
}
The Bus allows publish-subscribe-style communication between components.
func (*Bus) Close ¶ added in v0.3.0
func (b *Bus) Close()
Close a Bus until all Messages are sent to Subscribers.
type Message ¶
type Message struct {
// contains filtered or unexported fields
}
Message is send on the bus to all subscribed listeners.
func NewMessage ¶
NewMessage returns a new Message with a MessageID and embed data.
type MessageListener ¶
MessageListener is the signature of functions that can handle an EventMessage.
type Subscriber ¶
type Subscriber interface {
Subscribe(topic Topic, listener MessageListener) error
}
Subscriber allow subscribing a Topic's messages.
Click to show internal directories.
Click to hide internal directories.