Documentation ¶
Index ¶
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
}
EventBus is an event bus that notifies registered EventHandlers of published events.
func (*EventBus) AddHandler ¶
func (b *EventBus) AddHandler(handler eh.EventHandler, eventType eh.EventType)
AddHandler implements the AddHandler method of the EventHandler interface.
func (*EventBus) AddObserver ¶
func (b *EventBus) AddObserver(observer eh.EventObserver)
AddObserver implements the AddObserver method of the EventHandler interface.
func (*EventBus) PublishEvent ¶
PublishEvent publishes an event to all handlers capable of handling it. TODO: Put the event in a buffered channel consumed by another goroutine to simulate a distributed bus.
Click to show internal directories.
Click to hide internal directories.