Documentation ¶
Index ¶
- type TaskControl
- func (tc *TaskControl) Close()
- func (tc *TaskControl) GetExecuteInfo() ([]int, []int, []int)
- func (tc *TaskControl) GetResult(index int) (bool, *TaskData)
- func (tc *TaskControl) Hold()
- func (tc *TaskControl) Invoke(inData *TaskData) error
- func (tc *TaskControl) Reboot()
- func (tc *TaskControl) Release()
- func (tc *TaskControl) SetCtxProcessFunc(pollName string, pf func(ctx context.Context, inData interface{}) error, ...)
- type TaskData
- type TaskState
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TaskControl ¶
type TaskControl struct {
// contains filtered or unexported fields
}
func NewTaskControl ¶
func NewTaskControl(size int, log *logrus.Logger) (*TaskControl, error)
func (*TaskControl) Close ¶
func (tc *TaskControl) Close()
func (*TaskControl) GetExecuteInfo ¶
func (tc *TaskControl) GetExecuteInfo() ([]int, []int, []int)
GetExecuteInfo 获取 所有 Invoke 的执行情况,需要在 下一次 Invoke 拿走,否则会清空 成功执行的、未执行的、执行错误(超时)的
func (*TaskControl) GetResult ¶
func (tc *TaskControl) GetResult(index int) (bool, *TaskData)
GetResult 获取 TaskData 的反馈值,需要在 下一次 Invoke 拿走,否则会清空
func (*TaskControl) Invoke ¶
func (tc *TaskControl) Invoke(inData *TaskData) error
Invoke 向 SetCtxProcessFunc 设置的 Func 中提交数据处理
func (*TaskControl) Reboot ¶
func (tc *TaskControl) Reboot()
func (*TaskControl) Release ¶
func (tc *TaskControl) Release()
func (*TaskControl) SetCtxProcessFunc ¶
func (tc *TaskControl) SetCtxProcessFunc(pollName string, pf func(ctx context.Context, inData interface{}) error, oneCtxTimeOutSecond int)
SetCtxProcessFunc 设置后续需要用到的单个任务的 Func,注意,如果之前的任务没有完成,不应该再次调用函数。建议进行 Release 后,再次调用
Click to show internal directories.
Click to hide internal directories.