worker

package
v0.0.0-...-3a513bd Latest Latest
Warning

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

Go to latest
Published: May 21, 2018 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsConnectionError

func IsConnectionError(err error) bool

IsConnectionError returns true when err is connection problem

Types

type Worker

type Worker struct {
	sync.RWMutex

	ID           string
	Version      string
	MaxParallel  int32
	Capabilities []string // List of function handled by worker

	ConnectionFailure int32
	State             workerState
	Address           string
	// contains filtered or unexported fields
}

Worker represents an async worker node

func New

func New(address string) *Worker

func (*Worker) Connect

func (w *Worker) Connect() error

func (*Worker) Disconnect

func (w *Worker) Disconnect()

Disconnect will stop all monitoring of the worker The Worker object cannot be further used without reconnecting it first.

func (*Worker) GetCapabilities

func (w *Worker) GetCapabilities() []string

func (*Worker) IsActive

func (w *Worker) IsActive() bool

IsActive returns true if the worker is active

func (*Worker) Process

func (w *Worker) Process(j *job.Job) (bool, error)

func (*Worker) Stopped

func (w *Worker) Stopped() <-chan struct{}

func (*Worker) ValidationComplete

func (w *Worker) ValidationComplete()

Jump to

Keyboard shortcuts

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