local

package
v0.15.5 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2021 License: Apache-2.0 Imports: 7 Imported by: 14

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultQueueSize = 1000

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(options ...Option) *EventBus

NewEventBus creates a EventBus.

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) Close added in v0.5.0

func (b *EventBus) Close() error

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

func (*EventBus) Errors added in v0.4.0

func (b *EventBus) Errors() <-chan error

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

func (*EventBus) HandleEvent added in v0.7.0

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

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

func (*EventBus) HandlerType added in v0.7.0

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

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

type Group added in v0.4.0

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.4.0

func NewGroup() *Group

NewGroup creates a Group.

type Option added in v0.11.0

type Option func(*EventBus)

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.

func WithGroup added in v0.11.0

func WithGroup(g *Group) Option

WithGroup uses a specified group for transmitting events.

Jump to

Keyboard shortcuts

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