Version: v0.14.5 Latest Latest

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

Go to latest
Published: Aug 24, 2021 License: Apache-2.0 Imports: 10 Imported by: 0




This section is empty.


This section is empty.


This section is empty.


type EventBus

type EventBus struct {
	// contains filtered or unexported fields

EventBus is a local event bus that delegates handling of published events to all matching registered handlers, in order of registration.

func NewEventBus

func NewEventBus(addr, appID string, options ...Option) (*EventBus, error)

NewEventBus creates an EventBus, with optional GCP connection settings.

func (*EventBus) AddHandler

func (b *EventBus) AddHandler(ctx context.Context, m eh.EventMatcher, h eh.EventHandler) error

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

func (*EventBus) Errors

func (b *EventBus) Errors() <-chan eh.EventBusError

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

func (*EventBus) HandleEvent

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

HandleEvent implements the HandleEvent method of the eventhorizon.EventHandler interface.

func (*EventBus) HandlerType

func (b *EventBus) HandlerType() eh.EventHandlerType

HandlerType implements the HandlerType method of the eventhorizon.EventHandler interface.

func (*EventBus) Wait

func (b *EventBus) Wait()

Wait for all channels to close in the event bus group

type Option added in v0.11.0

type Option func(*EventBus) error

Option is an option setter used to configure creation.

func WithCodec added in v0.11.0

func WithCodec(codec eh.EventCodec) Option

WithCodec uses the specified codec for encoding events.

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL