local

package
v0.0.0-...-9345043 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 8, 2016 License: Apache-2.0 Imports: 1 Imported by: 0

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 NewEventBus

func NewEventBus() *EventBus

NewEventBus creates a EventBus.

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

func (b *EventBus) PublishEvent(event eh.Event)

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL