Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DataEvent ¶
type DataEvent struct {
Data interface{}
Topic string
}
DataEvent represents an event posted to a topic.
type EventBus ¶
type EventBus struct {
// contains filtered or unexported fields
}
EventBus stores the information about subscribers interested for a particular topic.
func (*EventBus) Subscribe ¶
func (eb *EventBus) Subscribe(topic string) *Subscription
Subscribe to the topic provided to receive data events.
type Subscription ¶
type Subscription struct {
Event <-chan DataEvent
Unsubscribe func()
}
Subscription represents a subscription to a topic.
Click to show internal directories.
Click to hide internal directories.