broadcast

package
v0.7.4 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const DefaultTimeout = time.Millisecond * 100

DefaultTimeout for broadcasting records to subscribers.

Variables

This section is empty.

Functions

func New

func New(bufferSize int, timeout time.Duration) *broadcaster

New constructs a broadcaster.

Types

type AggregateTypeSubscription

type AggregateTypeSubscription struct {
	AggregateType string
	Subscriber    RecordSubscriber
}

AggregateTypeSubscription defines an aggregate type subscriber.

type Broadcaster

type Broadcaster interface {
	Accept(record *rangedb.Record)
	SubscribeAllEvents(subscribers ...RecordSubscriber)
	UnsubscribeAllEvents(subscribers ...RecordSubscriber)
	SubscribeAggregateTypes(subscriber RecordSubscriber, aggregateTypes ...string)
	UnsubscribeAggregateTypes(subscriber RecordSubscriber, aggregateTypes ...string)
	Close()
}

Broadcaster defines a record broadcaster.

type RecordSubscriber

type RecordSubscriber interface {
	Receiver() SendRecordChan
	Stop()
}

RecordSubscriber defines how a rangedb.Record is received.

type SendRecordChan

type SendRecordChan chan<- *rangedb.Record

SendRecordChan is a write only channel for rangedb.Record.

Jump to

Keyboard shortcuts

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