recordsubscriber

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2021 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(config Config) *recordSubscriber

New constructs a record subscriber.

Types

type Config

type Config struct {
	BufferSize    int
	GetRecords    GetRecordsIteratorFunc
	ConsumeRecord ConsumeRecordFunc
	Subscribe     SubscribeFunc
	Unsubscribe   SubscribeFunc
	Ctx           context.Context
}

Config defines a record subscription configuration.

func AggregateTypesConfig

func AggregateTypesConfig(ctx context.Context, store rangedb.Store, broadcaster broadcast.Broadcaster, bufferLength int, aggregateTypes []string, consumeRecord ConsumeRecordFunc) Config

AggregateTypesConfig returns a configuration to subscribe to events by aggregate types.

func AllEventsConfig

func AllEventsConfig(ctx context.Context, store rangedb.Store, broadcaster broadcast.Broadcaster, bufferLength int, consumeRecord ConsumeRecordFunc) Config

AllEventsConfig returns a configuration to subscribe to all events.

type ConsumeRecordFunc

type ConsumeRecordFunc func(record *rangedb.Record) error

ConsumeRecordFunc defines a function to receiver a rangedb.Record

type GetRecordsIteratorFunc

type GetRecordsIteratorFunc func(globalSequenceNumber uint64) rangedb.RecordIterator

GetRecordsIteratorFunc defines a function to get events from a rangedb.Store. Typically from store.Events or store.Events store.EventsByAggregateTypes.

type SubscribeFunc

type SubscribeFunc func(subscriber broadcast.RecordSubscriber)

SubscribeFunc defines a function to receive a record subscriber

Jump to

Keyboard shortcuts

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