Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrCouldNotMarshalEvent = errors.New("could not marshal event")
ErrCouldNotMarshalEvent is when an event could not be marshaled into BSON.
View Source
var ErrCouldNotUnmarshalEvent = errors.New("could not unmarshal event")
ErrCouldNotUnmarshalEvent is when an event could not be unmarshaled into a concrete type.
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 NewEventBus ¶
NewEventBus creates a EventBus for remote events.
func NewEventBusWithPool ¶
NewEventBusWithPool creates a EventBus for remote events.
func (*EventBus) AddHandler ¶
func (b *EventBus) AddHandler(handler eh.EventHandler, eventType eh.EventType)
AddHandler adds a handler for a specific local event.
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.
Click to show internal directories.
Click to hide internal directories.