gcp

package
v0.0.0-...-b205a7c Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2017 License: Apache-2.0 Imports: 10 Imported by: 0

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. It will use the SimpleEventHandlingStrategy by default.

func NewEventBus

func NewEventBus(projectID, appID string) (*EventBus, error)

NewEventBus creates a EventBus.

func (*EventBus) AddHandler

func (b *EventBus) AddHandler(handler eh.EventHandler, eventType eh.EventType)

AddHandler implements the AddHandler method of the eventhorizon.EventBus interface.

func (*EventBus) AddObserver

func (b *EventBus) AddObserver(observer eh.EventObserver)

AddObserver implements the AddObserver method of the eventhorizon.EventBus interface.

func (*EventBus) Close

func (b *EventBus) Close() error

Close exits the receive goroutine by unsubscribing to all channels.

func (*EventBus) PublishEvent

func (b *EventBus) PublishEvent(ctx context.Context, event eh.Event)

PublishEvent implements the PublishEvent method of the eventhorizon.EventBus interface.

func (*EventBus) SetHandlingStrategy

func (b *EventBus) SetHandlingStrategy(strategy eh.EventHandlingStrategy)

SetHandlingStrategy implements the SetHandlingStrategy method of the eventhorizon.EventBus interface.

Jump to

Keyboard shortcuts

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