worker

package
v0.0.0-...-b4f7333 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2022 License: BSD-2-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	JobIDLabel         = "job_id"
	JobStatusCodeLabel = "status_code"
)

Functions

This section is empty.

Types

type JobWorker

type JobWorker struct {
	Done    bool
	Results map[int]int
	Job     proto.Job
	// contains filtered or unexported fields
}

func NewJobWorker

func NewJobWorker(log zerolog.Logger, metrics Metrics, j proto.Job) JobWorker

func (*JobWorker) HandleJob

func (jw *JobWorker) HandleJob()

type Metrics

type Metrics interface {
	IncJobs()
	IncJobRequestCount(id string, status int)
	ObserveJobRequestDurations(id string, status int, duration time.Duration)
}

func NewMetricsStore

func NewMetricsStore() Metrics

type WorkerRuntime

type WorkerRuntime interface {
	Connect() error
	Handle()
	Close()
}

func NewRuntime

func NewRuntime(m Metrics, logger zerolog.Logger, host string, port int) WorkerRuntime

Jump to

Keyboard shortcuts

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