Documentation ¶
Index ¶
- type PriorityQueue
- func (pq *PriorityQueue) Len() int
- func (pq *PriorityQueue) Less(i, j int) bool
- func (pq *PriorityQueue) Peek() *task.Task
- func (pq *PriorityQueue) Pop() interface{}
- func (pq *PriorityQueue) Push(x interface{})
- func (pq *PriorityQueue) Remove(t *task.Task)
- func (pq *PriorityQueue) Swap(i, j int)
- func (pq *PriorityQueue) UpdatePriority(t *task.Task, newPriority task.Priority)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PriorityQueue ¶
type PriorityQueue struct {
// contains filtered or unexported fields
}
PriorityQueue represents a task priority queue.
func NewPriorityQueue ¶
func NewPriorityQueue() *PriorityQueue
NewPriorityQueue creates a new PriorityQueue.
func (*PriorityQueue) Len ¶
func (pq *PriorityQueue) Len() int
Len returns the number of items in the priority queue.
func (*PriorityQueue) Less ¶
func (pq *PriorityQueue) Less(i, j int) bool
Less compares the priority of two tasks in the priority queue.
func (*PriorityQueue) Peek ¶
func (pq *PriorityQueue) Peek() *task.Task
Peek returns the highest-priority item from the priority queue without removing it.
func (*PriorityQueue) Pop ¶
func (pq *PriorityQueue) Pop() interface{}
Pop removes the highest-priority item from the priority queue.
func (*PriorityQueue) Push ¶
func (pq *PriorityQueue) Push(x interface{})
Push adds an item to the priority queue.
func (*PriorityQueue) Remove ¶
func (pq *PriorityQueue) Remove(t *task.Task)
Remove removes a specific task from the priority queue.
func (*PriorityQueue) Swap ¶
func (pq *PriorityQueue) Swap(i, j int)
Swap swaps two tasks in the priority queue.
func (*PriorityQueue) UpdatePriority ¶
func (pq *PriorityQueue) UpdatePriority(t *task.Task, newPriority task.Priority)
UpdatePriority updates the priority of a specific task in the priority queue.
Click to show internal directories.
Click to hide internal directories.