evictor

package
v1.4.4 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package evictor provides a scalable worker Group implementing service.Service and service.Scalable.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Enabled   bool
	Interval  time.Duration
	Instances int
}

Config configures the worker group.

type Group

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

Group is a scalable worker set.

func New

func New(name string, cfg Config) *Group

func (*Group) Instances

func (g *Group) Instances() int

func (*Group) IsActive

func (g *Group) IsActive() bool

func (*Group) Launch

func (g *Group) Launch(ctx context.Context) error

func (*Group) Logs

func (g *Group) Logs() <-chan service.ServiceLog

func (*Group) Metrics

func (g *Group) Metrics() service.Metrics

func (*Group) Off

func (g *Group) Off()

func (*Group) On

func (g *Group) On()

func (*Group) Reload

func (g *Group) Reload(ctx context.Context, cfg any) error

func (*Group) ScaleTo

func (g *Group) ScaleTo(n int) error

Scalable

func (*Group) SetBackend

func (g *Group) SetBackend(b workers.EvictionBackend)

func (*Group) Stop

func (g *Group) Stop(ctx context.Context) error

Jump to

Keyboard shortcuts

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