worker

package
v1.2.8 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Options

type Options struct {
	Enabled            bool
	RegisterBuiltins   bool
	Registry           *executor.Registry
	UnitRegistry       *workerunit.Registry
	CredentialResolver credential.Resolver
}

type RegistrationClient

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

func NewRegistrationClient

func NewRegistrationClient(client *http.Client) *RegistrationClient

func (*RegistrationClient) Heartbeat

func (c *RegistrationClient) Heartbeat(ctx context.Context, schedulerEndpoint, workerID string) error

func (*RegistrationClient) Register

func (c *RegistrationClient) Register(ctx context.Context, schedulerEndpoint string, worker workerproto.WorkerDescriptor) error

type RegistrationOptions

type RegistrationOptions struct {
	SchedulerEndpoint string
	Descriptor        workerproto.WorkerDescriptor
	Interval          time.Duration
	Client            *RegistrationClient
}

type Service

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

Service is the embedded worker runtime. It can be disabled when the deployment wants the scheduler to delegate execution to standalone worker processes only.

func NewService

func NewService(opts Options) (*Service, error)

func (*Service) ConsumeQueue

func (s *Service) ConsumeQueue(ctx context.Context, broker executor.QueueBroker, queue string, wait time.Duration) error

func (*Service) Descriptor

func (*Service) Enabled

func (s *Service) Enabled() bool

func (*Service) Handler

func (s *Service) Handler() http.Handler

func (*Service) MaintainRegistration

func (s *Service) MaintainRegistration(ctx context.Context, opts RegistrationOptions) error

func (*Service) RegisterExecutor

func (s *Service) RegisterExecutor(exec executor.Executor) error

func (*Service) Registry

func (s *Service) Registry() *executor.Registry

func (*Service) UnitRegistry

func (s *Service) UnitRegistry() *workerunit.Registry

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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