eventbus

package
v0.0.0-...-4581c0e Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ErrFunc

type ErrFunc func(err error)

ErrFunc used by handler to report error from observation

type GoroutinePoolGoFunc

type GoroutinePoolGoFunc func(func()) error

GoroutinePoolGoFunc processes actions via provided function

type GoroutinePoolHandler

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

GoroutinePoolHandler submit events to goroutine pool for process them.

func NewGoroutinePoolHandler

func NewGoroutinePoolHandler(
	goroutinePoolGo GoroutinePoolGoFunc,
	eventsHandler event.Handler,
	errFunc ErrFunc) *GoroutinePoolHandler

NewGoroutinePoolHandler creates new event processor.

func (*GoroutinePoolHandler) Handle

func (ep *GoroutinePoolHandler) Handle(ctx context.Context, iter event.Iter) (err error)

Handle pushes event to queue and process the queue by goroutine pool.

type Observer

type Observer interface {
	Close() error
	SetTopics(ctx context.Context, topics []string) error
}

Observer handles events from observation and forward them to event.EventHandler.

type Publisher

type Publisher interface {
	Publish(ctx context.Context, topics []string, groupId, aggregateId string, event event.Event) error
}

Publisher publish event to topics

type Subscriber

type Subscriber interface {
	Subscribe(ctx context.Context, subscriptionID string, topics []string, eh event.Handler) (Observer, error)
}

Subscriber creates observation over topics. When subscriptionID is same among more Subscribers events are balanced among them.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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