agent

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2014 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// TTL to use with all state pushed to Registry
	DefaultTTL = "30s"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Agent

type Agent struct {
	Machine machine.Machine
	// contains filtered or unexported fields
}

func New

func (*Agent) Heartbeat

func (a *Agent) Heartbeat(stop chan bool)

Heartbeat updates the Registry periodically with an acknowledgement of the Jobs this Agent is expected to be running.

func (*Agent) MarshalJSON added in v0.2.0

func (a *Agent) MarshalJSON() ([]byte, error)

type AgentReconciler added in v0.6.0

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

func NewReconciler added in v0.6.0

func NewReconciler(reg registry.Registry, verifier *sign.SignatureVerifier) *AgentReconciler

func (*AgentReconciler) Purge added in v0.6.0

func (ar *AgentReconciler) Purge(a *Agent)

Purge attempts to unload all Jobs that have been loaded locally

func (*AgentReconciler) Reconcile added in v0.6.0

func (ar *AgentReconciler) Reconcile(a *Agent)

Reconcile drives the local Agent's state towards the desired state stored in the Registry. Reconcile also attempts to bid for any outstanding job offers that the local Agent can run.

func (*AgentReconciler) Run added in v0.6.0

func (ar *AgentReconciler) Run(a *Agent, stop chan bool)

Run periodically attempts to reconcile the provided Agent until the stop channel is closed. Run will also reconcile in reaction to calls to Trigger. While a reconciliation is being attempted, calls to Trigger are ignored.

func (*AgentReconciler) Trigger added in v0.6.0

func (ar *AgentReconciler) Trigger()

Trigger causes Reconcile to run if the Agent is running but is not currently reconciling.

type UnitStatePublisher added in v0.6.0

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

func NewUnitStatePublisher added in v0.6.0

func NewUnitStatePublisher(mgr unit.UnitManager, reg registry.Registry, mach machine.Machine) *UnitStatePublisher

func (*UnitStatePublisher) Run added in v0.6.0

func (p *UnitStatePublisher) Run(beatchan <-chan *unit.UnitStateHeartbeat, stop chan bool)

Run caches all of the heartbeat objects from the provided channel, publishing them to the Registry every 5s. Heartbeat objects are also published as they are received on the channel.

Jump to

Keyboard shortcuts

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