worker

package
v0.1.20 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2018 License: MPL-2.0 Imports: 25 Imported by: 0

Documentation

Overview

Package worker is responsible for managing the claiming, executing, and resolution of tasks.

Index

Constants

This section is empty.

Variables

View Source
var ErrWorkerStoppedNow = errors.New("worker was interrupted by StopNow")

ErrWorkerStoppedNow is used to communicate that the worker was forcefully stopped. This could also be triggered by a plugin or engine.

Functions

func ConfigSchema

func ConfigSchema() schematypes.Object

ConfigSchema returns the schema for configuration.

Types

type Worker

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

A Worker processes tasks

func New

func New(config interface{}) (w *Worker, err error)

New creates a new Worker

func (*Worker) PayloadSchema

func (w *Worker) PayloadSchema() schematypes.Schema

PayloadSchema returns the schema for task.payload

func (*Worker) Start

func (w *Worker) Start() error

Start process tasks, returns ErrWorkerStoppedNow if not stopped gracefully.

func (*Worker) StopGracefully added in v0.1.0

func (w *Worker) StopGracefully()

StopGracefully stops claiming new tasks and returns nil from Work() when all currently running tasks are done.

func (*Worker) StopNow added in v0.1.0

func (w *Worker) StopNow()

StopNow aborts current tasks resolving worker-shutdown, and causes Work() to return an error.

Directories

Path Synopsis
Package taskrun provides abstractions to execute a run of a task given a task, engine, plugin, and other runtime objects required by plugin and engine.
Package taskrun provides abstractions to execute a run of a task given a task, engine, plugin, and other runtime objects required by plugin and engine.
Package workertest provides a framework for declarative definition of worker integration tests.
Package workertest provides a framework for declarative definition of worker integration tests.
fakequeue
Package fakequeue provides a fake implementation of taskcluster-queue in golang, The FakeQueue server stores tasks in-memory, it doesn't validate authentication, but implements most end-points correctly.
Package fakequeue provides a fake implementation of taskcluster-queue in golang, The FakeQueue server stores tasks in-memory, it doesn't validate authentication, but implements most end-points correctly.

Jump to

Keyboard shortcuts

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