MCPcopy Create free account
hub / github.com/flant/shell-operator / addFirst

Method addFirst

pkg/task/queue/task_storage.go:28–34  ·  view source on GitHub ↗

Private methods (without locking) addFirst adds tasks to the front of the queue (internal implementation)

(tasks ...task.Task)

Source from the content-addressed store, hash-verified

26
27// addFirst adds tasks to the front of the queue (internal implementation)
28func (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)
37func (ts *TaskStorage) removeFirst() task.Task {

Callers 2

AddFirstMethod · 0.95
ProcessResultMethod · 0.95

Calls 2

PushFrontMethod · 0.80
GetIdMethod · 0.65

Tested by

no test coverage detected