worker

package
v1.36.0 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HandleError

func HandleError(job types.Job, err error) *types.Response

Types

type Worker

type Worker struct {
	WorkerPool chan chan types.Job
	JobChannel chan types.Job
	// quit tells the worker to stop.
	Quit chan bool
	// Done is used to notify that the worker has stopped.
	Done     chan bool
	Handlers handlers.Handlers
	// contains filtered or unexported fields
}

Worker represents the worker that executes the job.

func NewWorker

func NewWorker(
	invClientHandler *clients.InventoryClientHandler,
	hScheduleCache *schedule_cache.HScheduleCacheClient,
	id int,
	workerPool chan chan types.Job,
) *Worker

func (Worker) Start

func (w Worker) Start()

Start method starts the run loop for the worker, listening for a quit channel in case we need to stop it.

func (Worker) Stop

func (w Worker) Stop()

Stop signals the worker to stop listening for work requests.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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