local

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultQueueSize = 10

DefaultQueueSize is the default queue size per handler for publishing events.

Functions

This section is empty.

Types

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(g *Group) *EventBus

NewEventBus creates a EventBus.

func (*EventBus) AddHandler

func (b *EventBus) AddHandler(m eh.EventMatcher, h eh.EventHandler)

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

func (*EventBus) AddObserver added in v0.6.1

func (b *EventBus) AddObserver(m eh.EventMatcher, h eh.EventHandler)

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

func (*EventBus) Close added in v0.6.1

func (b *EventBus) Close()

Close all the channels in the events bus group

func (*EventBus) Errors added in v0.6.1

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

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

func (*EventBus) PublishEvent

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

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

func (*EventBus) Wait added in v0.6.1

func (b *EventBus) Wait()

Wait for all channels to close in the event bus group

type Group added in v0.6.1

type Group struct {
	// contains filtered or unexported fields
}

Group is a publishing group shared by multiple event busses locally, if needed.

func NewGroup added in v0.6.1

func NewGroup() *Group

NewGroup creates a Group.

func (*Group) Close added in v0.6.1

func (g *Group) Close()

Close all the open channels

Jump to

Keyboard shortcuts

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