Iterate iterates over all tasks in the queue with a callback
(fn func(*list.Element[task.Task]))
| 204 | |
| 205 | // Iterate iterates over all tasks in the queue with a callback |
| 206 | func (ts *TaskStorage) Iterate(fn func(*list.Element[task.Task])) { |
| 207 | ts.mu.RLock() |
| 208 | defer ts.mu.RUnlock() |
| 209 | |
| 210 | for e := ts.items.Front(); e != nil; e = e.Next() { |
| 211 | fn(e) |
| 212 | } |
| 213 | } |
| 214 | |
| 215 | // RemoveElement removes an element from the list and updates the index |
| 216 | func (ts *TaskStorage) RemoveElement(element *list.Element[task.Task]) task.Task { |