worker

package
v0.5.45 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const EmptyQueueWaitTime = 2 * time.Second
View Source
const WorkerQueueBufferSize = 10000

Variables

This section is empty.

Functions

This section is empty.

Types

type Worker

type Worker struct {
	Concurrency int
	BufferSize  int
	Repository  result.Repository
	Runner      runner.Runner
	Log         *zap.SugaredLogger
}

func NewWorker

func NewWorker(resultsRepository result.Repository, runner runner.Runner) Worker

NewWorker returns new worker instance with data repository and runner

func (*Worker) PullExecution

func (w *Worker) PullExecution() (execution testkube.Execution, err error)

func (*Worker) PullExecutions

func (w *Worker) PullExecutions() chan testkube.Execution

PullExecutions gets executions from queue - returns executions channel

func (*Worker) Run

func (w *Worker) Run(executionChan chan testkube.Execution)

func (*Worker) RunExecution

func (w *Worker) RunExecution(ctx context.Context, e testkube.Execution) (testkube.Execution, error)

Jump to

Keyboard shortcuts

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