job

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2017 License: Apache-2.0 Imports: 13 Imported by: 16

Documentation

Overview

Package job holds code for managing task execution in robot. The primary concepts are the operations, the device on which jobs run, and the worker which is responsible for running jobs on a device. Devices are persistent, and might not be active, workers only exist for live devices.

Index

Constants

View Source
const (
	UnknownOperation = Operation_UnknownOperation
	Host             = Operation_Host
	Trace            = Operation_Trace
	Report           = Operation_Report
	Replay           = Operation_Replay
)
View Source
const (
	UnknownStatus = Status_UnknownStatus
	Running       = Status_Running
	Succeeded     = Status_Succeeded
	Failed        = Status_Failed
)

Variables

This section is empty.

Functions

func Serve

func Serve(ctx xctx.Context, grpcServer *grpc.Server, manager Manager) error

Serve wraps a manager in a grpc server.

Types

type DeviceHandler

type DeviceHandler func(context.Context, *Device) error

DeviceHandler is a function used to consume a stream of Devices.

type Manager

type Manager interface {
	// SearchDevices delivers matching workers to the supplied handler.
	SearchDevices(ctx context.Context, query *search.Query, handler DeviceHandler) error
	// SearchWorkers delivers matching workers to the supplied handler.
	SearchWorkers(ctx context.Context, query *search.Query, handler WorkerHandler) error
	// GetWorker finds or adds a worker.
	GetWorker(ctx context.Context, host *device.Instance, target *device.Instance, op Operation) (*Worker, error)
}

Manager is the abstract interface to the job manager.

func NewLocal

func NewLocal(ctx context.Context, library record.Library) (Manager, error)

NewLocal builds a new job manager that persists it's data in the supplied library.

func NewRemote

func NewRemote(ctx context.Context, conn *grpc.ClientConn) Manager

NewRemote returns a job manager that talks to a remote grpc job manager.

type WorkerHandler

type WorkerHandler func(context.Context, *Worker) error

WorkerHandler is a function used to consume a stream of Workers.

Directories

Path Synopsis
Package worker is a set of helpers for implementing common features of robot workers (see package job for more information about what a worker is).
Package worker is a set of helpers for implementing common features of robot workers (see package job for more information about what a worker is).

Jump to

Keyboard shortcuts

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