- BaseTask.GetID

This commit is contained in:
gazebo
2018-10-20 10:49:32 +08:00
parent 1c74a43c1b
commit 042d3b5616
2 changed files with 15 additions and 1 deletions

View File

@@ -25,6 +25,7 @@ type TaskList []ITask
type ITask interface {
Run()
GetID() string
GetResult(duration time.Duration) (retVal []interface{}, err error)
Cancel()
GetTotalItemCount() int
@@ -104,6 +105,10 @@ func (t *BaseTask) Init(parallelCount, batchSize int, isContinueWhenError bool,
t.C = t.finishChan
}
func (t *BaseTask) GetID() string {
return t.ID
}
func (t *BaseTask) GetResult(duration time.Duration) (retVal []interface{}, err error) {
if t.GetStatus() >= TaskStatusEndBegin {
return t.Result, t.Err