internal

package
v0.0.0-...-6d42826 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2025 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnsureRegisterWatcher

func EnsureRegisterWatcher[T any](ctx context.Context, reg WatcherRegistry, w eventsource.Watcher[T]) (string, T, error)

EnsureRegisterWatcher registers a watcher and returns the first set of changes.

func FirstResult

func FirstResult[T any](ctx context.Context, w eventsource.Watcher[T]) (T, error)

FirstResult checks whether the first set of returned changes are available and returns them, otherwise it kills the worker and waits for the error and returns it.

Types

type Watcher

type Watcher[T any] interface {
	worker.Worker
	Changes() <-chan T
}

Watcher defines a generic watcher over a set of changes.

type WatcherRegistry

type WatcherRegistry interface {
	// Register registers a watcher and returns a string that can be used
	// to unregister it.
	Register(worker.Worker) (string, error)
}

WatcherRegistry defines a generic registry for watchers.

Directories

Path Synopsis
mocks
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.
handlers

Jump to

Keyboard shortcuts

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