redis

package
v0.15.6 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2022 License: Apache-2.0 Imports: 10 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 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, clientID string, options ...Option) (*EventBus, error)

NewEventBus creates an EventBus, with optional 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) Close

func (b *EventBus) Close() error

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

func (*EventBus) Errors

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

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.

type IsFailed

type IsFailed func(*redis.XPendingExt) bool

IsFailed is a function to assert that does a message processed failed.

type Option

type Option func(*EventBus) error

Option is an option setter used to configure creation.

func WithCodec

func WithCodec(codec eh.EventCodec) Option

WithCodec uses the specified codec for encoding events.

func WithFailedCheckOption

func WithFailedCheckOption(isf IsFailed) Option

func WithFailedCheckStepOption

func WithFailedCheckStepOption(step time.Duration) Option

func WithRedisGroupStartId

func WithRedisGroupStartId(idx string) Option

func WithRedisOptions

func WithRedisOptions(opts *redis.Options) Option

WithRedisOptions uses the Redis options for the underlying client, instead of the defaults.

Jump to

Keyboard shortcuts

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