v1working

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2018 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	//RunErrCodeUnexpected is presented to the api when an unexpected error occurred during the run of the task
	RunErrCodeUnexpected = "ERR_UNEXPECTED"

	//RunResultUndefined is send to the server when
	RunResultUndefined = "-"
)

Functions

func IsEmptyDir added in v0.4.15

func IsEmptyDir(name string) (bool, error)

IsEmptyDir checks if a directory contains files

func RemoveContents

func RemoveContents(dir string) error

RemoveContents removes all contents of a directory

Types

type Conf

type Conf struct {
	ReceiveTimeout    time.Duration
	HeartbeatInterval time.Duration
}

Conf holds worker configuration

func DefaultConf

func DefaultConf() *Conf

DefaultConf creates a sensible configuration

type Worker

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

Worker is a longer running process that spawns processes based on task runs that arrive via the batch client

func NewWorker

func NewWorker(logger *log.Logger, batchClient workerClient, qops v1batch.QueueOps, projectID string, workloadID string, entrypoint, cmd []string, uploadConf *v1datatransfer.UploadConfig, conf *Conf) (w *Worker)

NewWorker creates a worker based on the provided configuration

func (*Worker) Start

func (w *Worker) Start(ctx context.Context)

Start will block and begins handling tasks run. It stops when context ctx ends

Jump to

Keyboard shortcuts

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