Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Dispatcher ¶
type Dispatcher struct {
Workers []*Worker
WorkerPool chan chan *Job
JobQueue chan *Job
LivePipelineState bool
// contains filtered or unexported fields
}
Dispatcher handles routing jobs to workers
func NewDispatcher ¶
func NewDispatcher(maxW int, livePipelineState bool) *Dispatcher
NewDispatcher creates a new Dispatcher
func NewDispatcherWithPlugins ¶
func NewDispatcherWithPlugins(maxW int, livePipelineState bool, pluginDir string) (*Dispatcher, error)
NewDispatcherWithPlugins creates a new Dispatcher with plugin search information
func (*Dispatcher) RunBlocking ¶
func (d *Dispatcher) RunBlocking()
Run creates workers and builds pool
func (*Dispatcher) Stop ¶
func (d *Dispatcher) Stop()
type Job ¶
type Job struct {
ID int64
InitialState map[string]string
PipelineDefinition *pipeline.PipelineDefinition
FlowPipeline *pipeline.FlowPipeline
PipelineCallback func(state pipeline.PipelineState)
}
Job defines the task to be executed by worker
type Worker ¶
type Worker struct {
ID int
WorkerPool chan chan *Job
JobChannel chan *Job
LivePipelineState bool
DispatcherRef *Dispatcher
// contains filtered or unexported fields
}
Worker represents the worker that executes the job
type WorkerError ¶
type WorkerError struct {
WorkerID int
Error error
ErrorTime time.Time
ErrorMessage string
Content string
}
WorkerError represents error encountered by worker.
type WorkerState ¶
type WorkerState struct {
WorkerID int
IsRunning bool
StartTime time.Time
IsRunningJob bool //TODO (cbergoon): Implement
JobStartTime time.Time //TODO (cbergoon): Implement
JobEndTime time.Time //TODO (cbergoon): Implement
CurrentJob *Job
Errors []*WorkerError
}
WorkerState Represents state information of reporting worker.
Click to show internal directories.
Click to hide internal directories.