worker

package
v1.2.20 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2026 License: Apache-2.0 Imports: 16 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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 ProtocolError added in v1.2.11

type ProtocolError struct {
	StatusCode int
	Response   workerproto.ErrorResponse
}

func (*ProtocolError) Error added in v1.2.11

func (e *ProtocolError) Error() string

type PullOptions added in v1.2.11

type PullOptions struct {
	SchedulerEndpoint string
	Descriptor        workerproto.WorkerDescriptor
	Interval          time.Duration
	RetryInterval     time.Duration
	Concurrency       int
	Client            *RegistrationClient
}

type RegistrationClient

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

func NewRegistrationClient

func NewRegistrationClient(client *http.Client) *RegistrationClient

func (*RegistrationClient) Complete added in v1.2.11

func (c *RegistrationClient) Complete(ctx context.Context, schedulerEndpoint string, completion workerproto.CompleteRequest) error

func (*RegistrationClient) Heartbeat

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

func (*RegistrationClient) Pull added in v1.2.11

func (c *RegistrationClient) Pull(ctx context.Context, schedulerEndpoint, workerID string) (*workerproto.Command, 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) MaintainPull added in v1.2.11

func (s *Service) MaintainPull(ctx context.Context, opts PullOptions) error

MaintainPull registers an outbound-only worker, leases commands from the scheduler, and retries completion with the same command_id until acknowledged.

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