watch

package
v0.0.0-...-f219f25 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2022 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RetryWatcher

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

RetryWatcher will make sure that in case the underlying watcher is closed (e.g. due to API timeout or etcd timeout) it will get restarted from the last point without the consumer even knowing about it. RetryWatcher does that by inspecting events and keeping track of resourceVersion. Especially useful when using watch.UntilWithoutRetry where premature termination is causing issues and flakes. Please note that this is not resilient to etcd cache not having the resource version anymore - you would need to use Informers for that.

func NewRetryWatcher

func NewRetryWatcher(initialResourceVersion string, watcherClient cache.Watcher) (*RetryWatcher, error)

NewRetryWatcher creates a new RetryWatcher. It will make sure that watches gets restarted in case of recoverable errors. The initialResourceVersion will be given to watch method when first called.

func (*RetryWatcher) Done

func (rw *RetryWatcher) Done() <-chan struct{}

Done allows the caller to be notified when Retry watcher stops.

func (*RetryWatcher) ResultChan

func (rw *RetryWatcher) ResultChan() <-chan watch.Event

ResultChan implements Interface.

func (*RetryWatcher) Stop

func (rw *RetryWatcher) Stop()

Stop implements Interface.

Jump to

Keyboard shortcuts

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