worker

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: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Do

func Do(c context.Context, w *Work)

Do retrieves a worker from the session and uses it to get work done.

func NewContext

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

NewContext returns a Context whose Value method returns the application's worker queue.

Types

type Assignment

type Assignment struct {
	Work   *Work
	Worker Worker
}

type Work

type Work struct {
	Host   string        `json:"host"`
	User   *model.User   `json:"user"`
	Repo   *model.Repo   `json:"repo"`
	Commit *model.Commit `json:"commit"`
}

type Worker

type Worker interface {
	Do(context.Context, *Work)
}

func FromContext

func FromContext(c context.Context) Worker

FromContext returns the worker queue associated with this context.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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