agent

package
v1.5.3 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2016 License: AGPL-3.0 Imports: 7 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Dispatcher

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

Dispatcher is responsible for managing a given services state and sending work to the Runner pool

func NewDispatcher

func NewDispatcher(cfg dropship.Config, t *Runner, wg *sync.WaitGroup, shutdownCh <-chan struct{}) (*Dispatcher, error)

NewDispatcher return a new Dispatcher.

func (*Dispatcher) Work

func (w *Dispatcher) Work()

Work is responsible for actually performing all the check, download, install and script execution for a given service

type Runner

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

Runner is a type of worker pool that takes its work over a channel this allows for a dispatcher to actually signal the work.

func NewRunner

func NewRunner(maxGoRoutines int) *Runner

NewRunner creates a new runner with the number go routines created and ready for work

func (*Runner) Do

func (r *Runner) Do(w Worker)

Do will schedule work on to the runner pull by placing a worker stuct on the channel

func (*Runner) Shutdown

func (r *Runner) Shutdown()

Shutdown will signal the pool to stop accepting work and finish any current jobs

type Worker

type Worker interface {
	Work()
}

Worker is a data type that can perform work.

Jump to

Keyboard shortcuts

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