stream

package
v0.0.0-...-51a0f74 Latest Latest
Warning

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

Go to latest
Published: May 2, 2024 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// PollInterval is the amount of time to wait between polling the database
	// for new stream events.
	PollInterval = time.Millisecond * 100
)

Variables

This section is empty.

Functions

This section is empty.

Types

type FileNotifier

type FileNotifier interface {
	// Changes returns a channel if a file was created or deleted.
	Changes() (<-chan bool, error)
}

FileNotifyWatcher represents a way to watch for changes in a namespace folder directory.

type Logger

type Logger interface {
	Infof(message string, args ...interface{})
	Debugf(message string, args ...interface{})
	Tracef(message string, args ...interface{})
	IsTraceEnabled() bool
}

Logger represents the logging methods called.

type Stream

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

Stream defines a worker that will poll the database for change events.

func New

func New(db coredatabase.TrackedDB, fileNotifier FileNotifier, clock clock.Clock, logger Logger) *Stream

New creates a new Stream.

func (*Stream) Changes

func (s *Stream) Changes() <-chan changestream.ChangeEvent

Changes returns a channel for a given namespace (database). The channel will return events represented by change log rows from the database. The change event IDs will be monotonically increasing (though not necessarily sequential). Events will be coalesced into a single change if they are for the same entity and edit type.

func (*Stream) Kill

func (w *Stream) Kill()

Kill is part of the worker.Worker interface.

func (*Stream) Wait

func (w *Stream) Wait() error

Wait is part of the worker.Worker interface.

Jump to

Keyboard shortcuts

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