smartrequeue

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: May 22, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewContext

func NewContext(ctx context.Context, entry *Entry) context.Context

Types

type Entry

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

func FromContext

func FromContext(ctx context.Context) *Entry

func (*Entry) Error

func (e *Entry) Error(err error) (ctrl.Result, error)

Error resets the duration to the minInterval and returns an empty Result and the error so that the controller-runtime can handle the exponential backoff for errors.

func (*Entry) Never

func (e *Entry) Never() (ctrl.Result, error)

Never deletes the entry from the store and returns an empty Result.

func (*Entry) Progressing

func (e *Entry) Progressing() (ctrl.Result, error)

Progressing resets the duration to the minInterval and returns a Result with that interval. Used when the external resource is still doing something (creating, deleting, updating, etc.)

func (*Entry) Stable

func (e *Entry) Stable() (ctrl.Result, error)

Stable returns a Result and increments the interval for the next iteration. Used when the external resource is stable (healthy or unhealthy).

type Store

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

func NewStore

func NewStore(minInterval, maxInterval time.Duration, multiplier float32) *Store

func (*Store) For

func (s *Store) For(obj client.Object) *Entry

Jump to

Keyboard shortcuts

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