* Removes the task and returns "true" if dequeueing is successful. Otherwise * returns "false", e.g. when this task is not currently enqueued. * @param {!TaskDef} task * @param {number} index of the task to remove. * @return {boolean}
(task, index)
| 135 | * @return {boolean} |
| 136 | */ |
| 137 | removeAtIndex(task, index) { |
| 138 | const existing = this.taskIdMap_[task.id]; |
| 139 | if (!existing || this.tasks_[index] != existing) { |
| 140 | return false; |
| 141 | } |
| 142 | this.tasks_.splice(index, 1); |
| 143 | delete this.taskIdMap_[task.id]; |
| 144 | return true; |
| 145 | } |
| 146 | |
| 147 | /** |
| 148 | * Removes tasks in queue that pass the callback test. |