eventbus

package
v0.0.0-...-5fa8032 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultPartitions = 32
	MinPartitions     = 1
	MaxPartitions     = 1024
)

Variables

This section is empty.

Functions

func HandlerFunc

func HandlerFunc(eventName string, handler, rollbackHandler func(context.Context, *event.Event) error) stream.EventHandler

func MutatorHandler

func MutatorHandler(mutator stream.EventSinker) stream.EventHandler

Types

type Channel

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

func NewChannel

func NewChannel(o ...Option) *Channel

func (*Channel) Close

func (b *Channel) Close() error

func (*Channel) Listen

func (b *Channel) Listen(ctx context.Context) error

func (*Channel) Publish

func (b *Channel) Publish(events []*event.Event) error

func (*Channel) Subscribe

func (b *Channel) Subscribe(streamName string, handlers ...stream.EventHandler)

type Deduplicator

type Deduplicator interface {
	SetVisit(context.Context, *event.Event) error
	HasVisit(context.Context, *event.Event) (bool, error)
}

type Option

type Option func(*Channel)

func WithChannelErrorHandler

func WithChannelErrorHandler(h stream.EventErrorHandler) Option

func WithChannelPartitions

func WithChannelPartitions(n int) Option

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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