worker

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2025 License: Apache-2.0 Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadWorkerDesc

func LoadWorkerDesc(metadata map[string]string) map[string]string

Types

type Option

type Option func(o *options)

func WithLogger

func WithLogger(logger log.Logger) Option

func WithReportResourceInterval

func WithReportResourceInterval(interval time.Duration) Option

func WithShutdownTimeout

func WithShutdownTimeout(timeout time.Duration) Option

func WithTriggerResync

func WithTriggerResync(interval time.Duration) Option

type Worker

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

func NewWorker

func NewWorker(
	id string,
	ip string,
	port int,
	discover discover.Interface,
	taskRepo taskrepo.Interface,
	opts ...Option,
) *Worker

func (*Worker) Run

func (w *Worker) Run(ctx context.Context) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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