supervisor

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2019 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClusterInstallationSupervisor

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

ClusterInstallationSupervisor finds cluster installations pending work and effects the required changes.

The degree of parallelism is controlled by a weighted semaphore, intended to be shared with other clients needing to coordinate background jobs.

func NewClusterInstallationSupervisor

func NewClusterInstallationSupervisor(store clusterInstallationStore, clusterInstallationProvisioner clusterInstallationProvisioner, instanceID string, logger log.FieldLogger) *ClusterInstallationSupervisor

NewClusterInstallationSupervisor creates a new ClusterInstallationSupervisor.

func (*ClusterInstallationSupervisor) Do

Do looks for work to be done on any pending cluster installations and attempts to schedule the required work.

func (*ClusterInstallationSupervisor) Supervise

func (s *ClusterInstallationSupervisor) Supervise(clusterInstallation *model.ClusterInstallation)

Supervise schedules the required work on the given cluster installation.

type ClusterSupervisor

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

ClusterSupervisor finds clusters pending work and effects the required changes.

The degree of parallelism is controlled by a weighted semaphore, intended to be shared with other clients needing to coordinate background jobs.

func NewClusterSupervisor

func NewClusterSupervisor(store clusterStore, clusterProvisioner clusterProvisioner, aws aws.AWS, instanceID string, logger log.FieldLogger) *ClusterSupervisor

NewClusterSupervisor creates a new ClusterSupervisor.

func (*ClusterSupervisor) Do

func (s *ClusterSupervisor) Do() error

Do looks for work to be done on any pending clusters and attempts to schedule the required work.

func (*ClusterSupervisor) Supervise

func (s *ClusterSupervisor) Supervise(cluster *model.Cluster)

Supervise schedules the required work on the given cluster.

type Doer

type Doer interface {
	Do() error
}

Doer describes an action to be done.

type InstallationSupervisor

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

InstallationSupervisor finds installations pending work and effects the required changes.

The degree of parallelism is controlled by a weighted semaphore, intended to be shared with other clients needing to coordinate background jobs.

func NewInstallationSupervisor

func NewInstallationSupervisor(store installationStore, installationProvisioner installationProvisioner, aws aws.AWS, instanceID string, threshold int, logger log.FieldLogger) *InstallationSupervisor

NewInstallationSupervisor creates a new InstallationSupervisor.

func (*InstallationSupervisor) Do

func (s *InstallationSupervisor) Do() error

Do looks for work to be done on any pending installations and attempts to schedule the required work.

func (*InstallationSupervisor) Supervise

func (s *InstallationSupervisor) Supervise(installation *model.Installation)

Supervise schedules the required work on the given installation.

type MultiDoer

type MultiDoer []Doer

MultiDoer is a slice of doers.

func (MultiDoer) Do

func (md MultiDoer) Do() error

Do executes each doer in turn, returning the first error.

type Scheduler

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

Scheduler schedules a doer for periodic, serial execution.

func NewScheduler

func NewScheduler(doer Doer, period time.Duration) *Scheduler

NewScheduler creates a new scheduler.

If the period is zero, the scheduler is never run, even if manually run. Otherwise, the period specifies how long to wait after its last successful execution.

func (*Scheduler) Close

func (s *Scheduler) Close() error

Close waits for any active doer to finish, terminates the main thread of the scheduler, and ensures the doer is no longer invoked.

func (*Scheduler) Do

func (s *Scheduler) Do() error

Do requests an execution of the scheduled doer.

The scheduler will never be run if the period is 0. If already running, the doer will be run again when done. Multiple calls to Notify while the doer is running will only trigger a single additional execution. Do never blocks.

Jump to

Keyboard shortcuts

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