counters

package
v0.12.7 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	CountersCache = sync.Pool{
		New: func() any {
			return new(Counters)
		},
	}
)

LoopsFacory and CountersCache are used to cache the loops and Counters structs. Used to reduce memory allocations of these highly used structs, improving performance.

Functions

This section is empty.

Types

type Counters added in v0.11.0

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

Counters is a loop which is responsible for executing a particular job. It shares the same life cycle as that job at that version. A Counters instance may be reused if the Job is updated, or simply the resource has not been garbage collected before a Job with the same name is created.

func New

func New(opts Options) *Counters

func (*Counters) Handle added in v0.11.0

func (c *Counters) Handle(ctx context.Context, event *queue.JobAction) error

func (*Counters) Reset added in v0.12.5

func (c *Counters) Reset()

Reset clears all fields so the Counters can be safely returned to CountersCache without retaining references to old data.

type Options

type Options struct {
	Actioner    actioner.Interface
	ModRevision int64
	Name        string
	Log         logr.Logger
}

Jump to

Keyboard shortcuts

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