Documentation ¶
Index ¶
- Constants
- Variables
- func CollectQSizeOption(v uint) workManagerOption
- func CollectWkrSizeOption(v uint) workManagerOption
- func New(opts ...workManagerOption) *scheduler
- func ProcessQSizeOption(v uint) workManagerOption
- func ProcessWkrSizeOption(v uint) workManagerOption
- func PublishQSizeOption(v uint) workManagerOption
- func PublishWkrSizeOption(v uint) workManagerOption
- type TaskWatcher
- type WorkflowState
Constants ¶
const ( // DefaultDeadlineDuration - The default timeout is 5 second DefaultDeadlineDuration = time.Second * 5 // DefaultStopOnFailure - The default stopping a failure is after three tries DefaultStopOnFailure = 3 )
Variables ¶
var ( // HandlerRegistrationName registers a handler with the event manager HandlerRegistrationName = "scheduler" // ErrMetricManagerNotSet - The error message for metricManager is not set ErrMetricManagerNotSet = errors.New("MetricManager is not set.") // ErrSchedulerNotStarted - The error message for scheduler is not started ErrSchedulerNotStarted = errors.New("Scheduler is not started.") // ErrTaskAlreadyRunning - The error message for task is already running ErrTaskAlreadyRunning = errors.New("Task is already running.") // ErrTaskAlreadyStopped - The error message for task is already stopped ErrTaskAlreadyStopped = errors.New("Task is already stopped.") // ErrTaskDisabledNotRunnable - The error message for task is disabled and cannot be started ErrTaskDisabledNotRunnable = errors.New("Task is disabled. Cannot be started.") )
var ( // ErrTaskNotFound - The error message for task not found ErrTaskNotFound = errors.New("Task not found") // ErrTaskNotStopped - The error message for task must be stopped ErrTaskNotStopped = errors.New("Task must be stopped") // ErrTaskHasAlreadyBeenAdded - The error message for task has already been added ErrTaskHasAlreadyBeenAdded = errors.New("Task has already been added") // ErrTaskDisabledOnFailures - The error message for task disabled due to consecutive failures ErrTaskDisabledOnFailures = errors.New("Task disabled due to consecutive failures") // ErrTaskNotDisabled - The error message for task must be disabled ErrTaskNotDisabled = errors.New("Task must be disabled") )
var ( WorkflowStateLookup = map[WorkflowState]string{ WorkflowStopped: "Stopped", WorkflowStarted: "Started", } ErrNullCollectNode = errors.New("Missing collection node in workflow map") ErrNoMetricsInCollectNode = errors.New("Collection node has not metrics defined to collect") )
WorkflowStateLookup map and error vars
Functions ¶
func CollectQSizeOption ¶
func CollectQSizeOption(v uint) workManagerOption
CollectQSizeOption sets the collector queue size(length) and returns the previous queue option state.
func CollectWkrSizeOption ¶
func CollectWkrSizeOption(v uint) workManagerOption
CollectWkrSizeOption sets the collector worker pool size and returns the previous collector worker pool state.
func New ¶
func New(opts ...workManagerOption) *scheduler
New returns an instance of the scheduler The MetricManager must be set before the scheduler can be started. The MetricManager must be started before it can be used.
func ProcessQSizeOption ¶
func ProcessQSizeOption(v uint) workManagerOption
ProcessQSizeOption sets the processor queue size(length) and returns the previous queue option state.
func ProcessWkrSizeOption ¶
func ProcessWkrSizeOption(v uint) workManagerOption
ProcessWkrSizeOption sets the processor worker pool size and return the previous processor worker pool state.
func PublishQSizeOption ¶
func PublishQSizeOption(v uint) workManagerOption
PublishQSizeOption sets the publisher queue size(length) and returns the previous queue option state.
func PublishWkrSizeOption ¶
func PublishWkrSizeOption(v uint) workManagerOption
PublishWkrSizeOption sets the publisher worker pool size and returns the previous previous publisher worker pool state.
Types ¶
type TaskWatcher ¶
type TaskWatcher struct {
// contains filtered or unexported fields
}
TaskWatcher struct type
func (*TaskWatcher) Close ¶
func (t *TaskWatcher) Close() error
Close stops watching a task. Cannot be restarted.
type WorkflowState ¶
type WorkflowState int
WorkflowState int type
const ( WorkflowStopped WorkflowState = iota WorkflowStarted )
Workflow state constants