workers

package
v1.8.3 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2025 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package workers exposes backend interfaces used by worker groups.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CallFreq added in v1.6.0

type CallFreq struct {
	RateLimit int           `json:"limit_per_sec,omitempty"`
	TickFreq  time.Duration `json:"interval_ns,omitempty"`
}

func NewCallFreq added in v1.6.0

func NewCallFreq(rateLimit int, tickFreq time.Duration) *CallFreq

func (*CallFreq) Clone added in v1.8.1

func (q *CallFreq) Clone() orchestrator.Freq

func (*CallFreq) GetRateLimit added in v1.8.1

func (q *CallFreq) GetRateLimit() int

func (*CallFreq) GetTickFreq added in v1.8.1

func (q *CallFreq) GetTickFreq() time.Duration

func (*CallFreq) IsRateLimitDefined added in v1.6.0

func (q *CallFreq) IsRateLimitDefined() bool

func (*CallFreq) IsTickFreqDefined added in v1.6.0

func (q *CallFreq) IsTickFreqDefined() bool

func (*CallFreq) SetRateLimit added in v1.8.2

func (q *CallFreq) SetRateLimit(new int) orchestrator.Freq

func (*CallFreq) SetTickFreq added in v1.8.2

func (q *CallFreq) SetTickFreq(new time.Duration) orchestrator.Freq

type Config

type Config struct {
	Enabled  bool              `json:"enabled"`
	Replicas int               `json:"replicas"`
	Freq     orchestrator.Freq `json:"frequency"`
}

func NewConfig added in v1.5.0

func NewConfig(enabled bool, freq orchestrator.Freq, replicas int) *Config

func (*Config) Clone added in v1.8.1

func (c *Config) Clone() orchestrator.Config

Clone - make a deep copy of config (safe for mutation).

func (*Config) GetFreq added in v1.6.0

func (c *Config) GetFreq() orchestrator.Freq

func (*Config) GetReplicas added in v1.5.0

func (c *Config) GetReplicas() int

func (*Config) IsEnabled added in v1.8.1

func (c *Config) IsEnabled() bool

func (*Config) SetEnabled added in v1.5.0

func (c *Config) SetEnabled(v bool) orchestrator.Config

func (*Config) SetFreq added in v1.6.0

func (c *Config) SetFreq(freq orchestrator.Freq) orchestrator.Config

func (*Config) SetReplicas added in v1.5.0

func (c *Config) SetReplicas(n int) orchestrator.Config

type EvictionBackend

type EvictionBackend interface {
	Len() int64
	Mem() int64
	SoftMemoryLimitOvercome() bool
	SoftEvictUntilWithinLimit(backoff int64) (freed, evicted int64)
}

type RefreshBackend

type RefreshBackend interface {
	Len() int64
	Mem() int64
	PeekExpiredTTL() (*model.Entry, bool)
	OnTTL(entry *model.Entry) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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