Documentation ¶
Index ¶
- Constants
- func NewTask(strategy definition.Strategy, task definition.Task, store store.Store, ...) (types.Worker, error)
- func RegisterTaskInst(task types.TaskBase)
- func RegisterTaskInstName(name string, task types.TaskBase)
- func RegisterTaskType(task types.TaskBase)
- func RegisterTaskTypeName(name string, task types.TaskBase)
- type BatchExecutor
- type NormalModel
- type SingleExecutor
- type StreamModel
- type TaskExecutor
- type TaskModel
- type TaskWorker
Constants ¶
View Source
const (
RUNTIME_EMPTY = "<empty>"
)
Variables ¶
This section is empty.
Functions ¶
func NewTask ¶
func NewTask(strategy definition.Strategy, task definition.Task, store store.Store, schedulerId string) (types.Worker, error)
NewTask creates a new task and initials necessary fields
Please don't initial TaskWorker manually
func RegisterTaskInst ¶
RegisterTaskInst registers a task in single instance model with key inferred by its type
func RegisterTaskInstName ¶
RegisterTaskInstName registers a task in single instance model with given key
func RegisterTaskType ¶
RegisterTaskType registers a task type with key inferred by its type
func RegisterTaskTypeName ¶
RegisterTaskTypeName registers a task type with key
Types ¶
type BatchExecutor ¶
type BatchExecutor struct {
// contains filtered or unexported fields
}
func (*BatchExecutor) ExecuteOrReturn ¶
func (m *BatchExecutor) ExecuteOrReturn() bool
type NormalModel ¶
type NormalModel struct {
// contains filtered or unexported fields
}
func NewNormalModel ¶
func NewNormalModel(worker *TaskWorker) *NormalModel
func (*NormalModel) LoopOnce ¶
func (m *NormalModel) LoopOnce()
func (*NormalModel) Stop ¶
func (m *NormalModel) Stop()
type SingleExecutor ¶
type SingleExecutor struct {
// contains filtered or unexported fields
}
func (*SingleExecutor) ExecuteOrReturn ¶
func (m *SingleExecutor) ExecuteOrReturn() bool
type StreamModel ¶
type StreamModel struct {
// contains filtered or unexported fields
}
func NewStreamModel ¶
func NewStreamModel(worker *TaskWorker) *StreamModel
func (*StreamModel) LoopOnce ¶
func (m *StreamModel) LoopOnce()
func (*StreamModel) Stop ¶
func (m *StreamModel) Stop()
type TaskExecutor ¶
type TaskExecutor interface { // ExecuteOrReturn returns false indicating no element in queue ExecuteOrReturn() bool }
type TaskWorker ¶
type TaskWorker struct { types.Worker // statistics NextBeginTime int64 Statistics definition.Statistics // contains filtered or unexported fields }
TaskWorker implements a task-driven worker.
Strategy.Bind should be the identifier of task(on console panel).
func (*TaskWorker) Start ¶
func (w *TaskWorker) Start(strategyId, parameter string) error
func (*TaskWorker) Stop ¶
func (w *TaskWorker) Stop(strategyId, parameter string) error
Click to show internal directories.
Click to hide internal directories.