WaitForTaskByID waits for task with given id to be processed
(ID int)
| 251 | |
| 252 | // WaitForTaskByID waits for task with given id to be processed |
| 253 | func (list *List) WaitForTaskByID(ID int) (Task, error) { |
| 254 | list.Lock() |
| 255 | wgTask, ok := list.wgTasks[ID] |
| 256 | list.Unlock() |
| 257 | if !ok { |
| 258 | return Task{}, fmt.Errorf("could not find task with id %v", ID) |
| 259 | } |
| 260 | |
| 261 | wgTask.Wait() |
| 262 | return list.GetTaskByID(ID) |
| 263 | } |
| 264 | |
| 265 | // GetTaskErrorByID returns the Task error for a given id |
| 266 | func (list *List) GetTaskErrorByID(ID int) (error, error) { |