instancepoller

package
v0.0.0-...-4bd6544 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ShortPoll        = 1 * time.Second
	ShortPollBackoff = 2.0
	LongPoll         = 15 * time.Minute
)

ShortPoll and LongPoll hold the polling intervals for the instance updater. When a machine has no address or is not started, it will be polled at ShortPoll intervals until it does, exponentially backing off with an exponent of ShortPollBackoff until a maximum(ish) of LongPoll.

When a machine has an address and is started LongPoll will be used to check that the instance address or status has not changed.

Functions

func Manifold

func Manifold(config ManifoldConfig) dependency.Manifold

Manifold returns a Manifold that encapsulates the instancepoller worker.

func NewWorker

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

NewWorker returns a worker that keeps track of the machines in the state and polls their instance addresses and status periodically to keep them up to date.

Types

type Config

type Config struct {
	Clock   clock.Clock
	Delay   time.Duration
	Facade  *instancepoller.API
	Environ InstanceGetter
}

func (Config) Validate

func (config Config) Validate() error

type InstanceGetter

type InstanceGetter interface {
	Instances(ids []instance.Id) ([]instance.Instance, error)
}

type ManifoldConfig

type ManifoldConfig struct {
	APICallerName string
	ClockName     string
	Delay         time.Duration
	EnvironName   string
}

ManifoldConfig describes the resources used by the instancepoller worker.

Jump to

Keyboard shortcuts

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