changefeed

package
v0.0.0-...-ad00200 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewSubscriptionsChangefeedCache

func NewSubscriptionsChangefeedCache(m metrics.Emitter, onlyValidSubscriptions bool) *subscriptionsChangeFeedResponder

func RunChangefeed

func RunChangefeed[F any, X api.DocumentList[F]](
	ctx context.Context,
	log *logrus.Entry,
	iterator database.DocumentIterator[F, X],
	changefeedInterval time.Duration,
	changefeedBatchSize int,
	responder ChangefeedConsumer[F],
	stop <-chan struct{},
)

Types

type ChangefeedConsumer

type ChangefeedConsumer[F any] interface {
	// OnDoc is called with each document returned from the list from Next()
	OnDoc(F)
	// OnAllPendingProcessed is when no more pages are returned from Next()
	OnAllPendingProcessed()
	// Lock is called before a page is processed
	Lock()
	// Unlock is called after a page is processed
	Unlock()
}

Generic interface of a consumer that NewChangefeed will call with documents, completed pages, etc.

type SubscriptionsCache

type SubscriptionsCache interface {
	ChangefeedConsumer[*api.SubscriptionDocument]

	GetCacheSize() int
	GetSubscription(string) (subscriptionInfo, bool)
	GetLastProcessed() (time.Time, bool)
	WaitForInitialPopulation()
}

Jump to

Keyboard shortcuts

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