lifetimer

package
v1.7.1 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2025 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package refresher 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 driven by governor.Transport. It mirrors the architecture of the evictor Group you provided.

func New

func New(ctx context.Context, cfg config.Config, name string, backend workers.RefreshBackend) *Group

New constructs a new refresher Group.

The style mirrors your evictor: a root context is accepted, and a typed backend is injected. The governor.Transport will be provided later via Serve().

func (*Group) Name

func (g *Group) Name() string

func (*Group) Replicas

func (g *Group) Replicas() int

func (*Group) Serve

func (g *Group) Serve(t orchestrator.Transport)

Serve wires the governor.Transport and starts the control loop. The loop reacts to Serve/On/Off/ScaleTo/Reload/Stop typed channels.

func (*Group) Transport

func (g *Group) Transport() orchestrator.Transport

Jump to

Keyboard shortcuts

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