workers

package
v1.34.0 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2026 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ListWorkersParams

type ListWorkersParams struct {
	Query         string
	PageSize      int
	NextPageToken []byte // Opaque token from a previous response to resume pagination.
}

ListWorkersParams contains parameters for listing workers.

type ListWorkersResponse

type ListWorkersResponse struct {
	Workers       []*workerpb.WorkerHeartbeat
	NextPageToken []byte // Opaque token for the next page; nil if no more results.
}

ListWorkersResponse contains the result of listing workers.

type Registry

type Registry interface {
	RecordWorkerHeartbeats(nsID namespace.ID, nsName namespace.Name, workerHeartbeat []*workerpb.WorkerHeartbeat)
	ListWorkers(nsID namespace.ID, params ListWorkersParams) (ListWorkersResponse, error)
	DescribeWorker(nsID namespace.ID, workerInstanceKey string) (*workerpb.WorkerHeartbeat, error)
}

func NewRegistry

func NewRegistry(lc fx.Lifecycle, params RegistryParams) Registry

NewRegistry creates a workers heartbeat registry with the given parameters.

type RegistryParams

type RegistryParams struct {
	NumBuckets       dynamicconfig.IntPropertyFn
	TTL              dynamicconfig.DurationPropertyFn
	MinEvictAge      dynamicconfig.DurationPropertyFn
	MaxItems         dynamicconfig.IntPropertyFn
	EvictionInterval dynamicconfig.DurationPropertyFn
	MetricsHandler   metrics.Handler
	MetricsConfig    WorkerMetricsConfig
}

RegistryParams contains all parameters for creating a worker registry.

type WorkerHeartbeatPropertyFunc

type WorkerHeartbeatPropertyFunc func(*workerpb.WorkerHeartbeat) string

type WorkerMetricsConfig

type WorkerMetricsConfig struct {
	EnablePluginMetrics            dynamicconfig.BoolPropertyFn
	EnablePollerAutoscalingMetrics dynamicconfig.BoolPropertyFn
	BreakdownMetricsByTaskQueue    dynamicconfig.BoolPropertyFnWithTaskQueueFilter
	ExternalPayloadsEnabled        dynamicconfig.BoolPropertyFnWithNamespaceFilter
}

WorkerMetricsConfig contains dynamic config flags for worker-related metrics.

Jump to

Keyboard shortcuts

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