worker

package
v0.9.0-beta Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2015 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PluginLoadedType = iota
	PluginUnloadedType
)
View Source
const (
	TaskCreatedType = iota
	TaskStoppedType
	TaskStartedType
	TaskRemovedType
)

Variables

View Source
var (
	PluginRequestTypeLookup = map[PluginRequestType]string{
		PluginLoadedType:   "Loaded",
		PluginUnloadedType: "Unloaded",
	}

	TaskRequestTypeLookup = map[TaskRequestType]string{
		TaskCreatedType: "Created",
		TaskStoppedType: "Stopped",
		TaskStartedType: "Started",
		TaskRemovedType: "Removed",
	}
)

Functions

func DispatchWorkers

func DispatchWorkers(nworkers int, pluginQueue chan PluginRequest, taskQueue chan TaskRequest, quitChan chan struct{}, workerWaitGroup *sync.WaitGroup, cp ManagesPlugins, tm ManagesTasks, mm getsMembers)

Types

type ManagesPlugins

type ManagesPlugins interface {
	Load(*core.RequestedPlugin) (core.CatalogedPlugin, serror.SnapError)
	Unload(plugin core.Plugin) (core.CatalogedPlugin, serror.SnapError)
	PluginCatalog() core.PluginCatalog
}

type ManagesTasks

type ManagesTasks interface {
	GetTask(id string) (core.Task, error)
	CreateTaskTribe(sch schedule.Schedule, wfMap *wmap.WorkflowMap, startOnCreate bool, opts ...core.TaskOption) (core.Task, core.TaskErrors)
	StopTaskTribe(id string) []serror.SnapError
	StartTaskTribe(id string) []serror.SnapError
	RemoveTaskTribe(id string) error
}

type Member

type Member interface {
	GetAddr() net.IP
	GetRestPort() string
	GetRestProto() string
	GetRestInsecureSkipVerify() bool
	GetName() string
}

type PluginRequest

type PluginRequest struct {
	Plugin      core.Plugin
	RequestType PluginRequestType
	// contains filtered or unexported fields
}

type PluginRequestType

type PluginRequestType int

func (PluginRequestType) String

func (p PluginRequestType) String() string

type Task

type Task struct {
	ID            string
	StartOnCreate bool
}

type TaskRequest

type TaskRequest struct {
	Task        Task
	RequestType TaskRequestType
	// contains filtered or unexported fields
}

type TaskRequestType

type TaskRequestType int

func (TaskRequestType) String

func (t TaskRequestType) String() string

Jump to

Keyboard shortcuts

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