worker

package
v0.1.15 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2018 License: MPL-2.0 Imports: 25 Imported by: 1 module, 3 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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