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
- func BindRegistry(ctx context.Context) context.Context
- func LockDevice(ctx context.Context, d bind.Device) error
- func OnDeviceAdded(ctx context.Context, ...)
- func Serve(ctx xctx.Context, grpcServer *grpc.Server, manager Manager) error
- func UnlockDevice(ctx context.Context, d bind.Device) error
- type DeviceHandler
- type Manager
- type WorkerHandler
Constants ¶
const ( UnknownOperation = Operation_UnknownOperation Host = Operation_Host Trace = Operation_Trace Report = Operation_Report Replay = Operation_Replay )
const ( UnknownStatus = Status_UnknownStatus Running = Status_Running Succeeded = Status_Succeeded Failed = Status_Failed )
Variables ¶
This section is empty.
Functions ¶
func BindRegistry ¶ added in v1.1.0
BindRegistry creates a new device registry to monitor new Android devices and returns the context which is bound to the created registry.
func LockDevice ¶ added in v1.1.0
LockDevice reserves the given device for the requester, prevents the device to be used by other clients.
func OnDeviceAdded ¶ added in v1.1.0
func OnDeviceAdded(ctx context.Context, onAdded func(ctx context.Context, host *device.Instance, target bind.Device))
OnDeviceAdded registers onAdded to be called whenever a new Android device is added.
Types ¶
type DeviceHandler ¶
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.
type WorkerHandler ¶
WorkerHandler is a function used to consume a stream of Workers.
Source Files ¶
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). |