manager

package
v0.0.0-...-a355528 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2017 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

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

Manager manages the plugins startup, stop, etc.

func ManagePlugins

func ManagePlugins(rules []launch.Rule,
	plugins func() discovery.Plugins, mustAll bool, scanInterval time.Duration) (*Manager, error)

ManagePlugins returns a manager that can manage the start up and stopping of plugins.

func (*Manager) Launch

func (m *Manager) Launch(exec string, key string, name plugin.Name, options *types.Any) error

Launch launches the plugin

func (*Manager) Rules

func (m *Manager) Rules() []launch.Rule

Rules returns a list of plugins that can be launched via this manager

func (*Manager) Start

func (m *Manager) Start(rules []launch.Rule) error

Start starts the manager

func (*Manager) StartPluginsFromSpecs

func (m *Manager) StartPluginsFromSpecs(specs []types.Spec, onError func(error) bool) error

StartPluginsFromSpecs starts up the plugins referenced in the specs

func (*Manager) Stop

func (m *Manager) Stop()

Stop stops the manager

func (*Manager) Terminate

func (m *Manager) Terminate(lookup []string) error

Terminate stops the plugins. Note this is accomplished by sending a signal TERM to the process found at the lookup.pid file. For inproc plugins, this will effectively kill all the plugins that run in that process. TODO - selectively terminate inproc plugins without taking down the process.

func (*Manager) TerminateAll

func (m *Manager) TerminateAll() error

TerminateAll terminates all the plugins.

func (*Manager) TerminateRunning

func (m *Manager) TerminateRunning() error

TerminateRunning terminates those that have been started.

func (*Manager) WaitForAllShutdown

func (m *Manager) WaitForAllShutdown()

WaitForAllShutdown blocks until all the plugins stopped.

func (*Manager) WaitStarting

func (m *Manager) WaitStarting()

WaitStarting blocks until a current batch of plugins completed starting up.

Jump to

Keyboard shortcuts

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