Private methods (without locking) addFirst adds tasks to the front of the queue (internal implementation)
(tasks ...task.Task)
| 26 | |
| 27 | // addFirst adds tasks to the front of the queue (internal implementation) |
| 28 | func (ts *TaskStorage) addFirst(tasks ...task.Task) { |
| 29 | // Add tasks in reverse order so the first task becomes the new head |
| 30 | for i := len(tasks) - 1; i >= 0; i-- { |
| 31 | element := ts.items.PushFront(tasks[i]) |
| 32 | ts.idIndex[tasks[i].GetId()] = element |
| 33 | } |
| 34 | } |
| 35 | |
| 36 | // removeFirst removes and returns the first task (internal implementation) |
| 37 | func (ts *TaskStorage) removeFirst() task.Task { |
no test coverage detected