director

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2015 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewContext

func NewContext(parent context.Context, w worker.Worker) context.Context

NewContext returns a Context whose Value method returns the director.

Types

type Director

type Director struct {
	sync.Mutex
	// contains filtered or unexported fields
}

Director manages workloads and delegates to workers.

func New

func New() *Director

func (*Director) Do

func (d *Director) Do(c context.Context, work *worker.Work)

Do processes the work request async.

func (*Director) GetAssignemnts

func (d *Director) GetAssignemnts() []*worker.Assignment

GetAssignments returns a list of assignments. The assignment type is a structure that stores the work being performed and the assigned worker.

func (*Director) GetPending

func (d *Director) GetPending() []*worker.Work

GetPending returns a list of all work that is pending assignment to a worker.

func (*Director) GetStarted

func (d *Director) GetStarted() []*worker.Work

GetStarted returns a list of all jobs that are assigned and being worked on.

Jump to

Keyboard shortcuts

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