Documentation ¶
Index ¶
- type SimplePriorityQueue
- func (spq SimplePriorityQueue) Len() int
- func (spq SimplePriorityQueue) Less(i, j int) bool
- func (spq *SimplePriorityQueue) Pop() interface{}
- func (spq *SimplePriorityQueue) Push(x interface{})
- func (spq SimplePriorityQueue) Swap(i, j int)
- func (spq *SimplePriorityQueue) Update(task *SimpleTask, dbID int64, value string, priority int)
- type SimpleTask
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SimplePriorityQueue ¶
type SimplePriorityQueue []*SimpleTask
SimplePriorityQueue holds a list of tasks
func (SimplePriorityQueue) Len ¶
func (spq SimplePriorityQueue) Len() int
Len is the length of a simple priority queue (interface function)
func (SimplePriorityQueue) Less ¶
func (spq SimplePriorityQueue) Less(i, j int) bool
Less helps Pop to figure out what is the highest priority (interface function)
func (*SimplePriorityQueue) Pop ¶
func (spq *SimplePriorityQueue) Pop() interface{}
Pop the last item at the queue (interface function)
func (*SimplePriorityQueue) Push ¶
func (spq *SimplePriorityQueue) Push(x interface{})
Push pushes a new item to the end of the queue (interface function)
func (SimplePriorityQueue) Swap ¶
func (spq SimplePriorityQueue) Swap(i, j int)
Swap changes the position of two jobs (interface function)
func (*SimplePriorityQueue) Update ¶
func (spq *SimplePriorityQueue) Update(task *SimpleTask, dbID int64, value string, priority int)
Update the current task
type SimpleTask ¶
type SimpleTask struct { DBID int64 Value string Priority int // contains filtered or unexported fields }
SimpleTask holds details about task to do
Click to show internal directories.
Click to hide internal directories.