modelworkermanager

package
v0.0.0-...-6cf1bc9 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2016 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(config Config) (worker.Worker, error)

Types

type Backend

type Backend interface {
	WatchModels() state.StringsWatcher
}

Backend defines the State functionality used by the manager worker.

type Config

type Config struct {
	ControllerUUID string
	Backend        Backend
	NewWorker      NewWorkerFunc
	ErrorDelay     time.Duration
}

Config holds the dependencies and configuration necessary to run a model worker manager.

func (Config) Validate

func (config Config) Validate() error

Validate returns an error if config cannot be expected to drive a functional model worker manager.

type NewWorkerFunc

type NewWorkerFunc func(controllerUUID, modelUUID string) (worker.Worker, error)

NewWorkerFunc should return a worker responsible for running all a model's required workers; and for returning nil when there's no more model to manage.

Jump to

Keyboard shortcuts

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