priorityqueue

package
v0.52.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 24, 2022 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Item

type Item struct {
	Value    embedder.FlutterTask // The value of the item
	FireTime time.Time            // The priority of the item in the queue.
	// contains filtered or unexported fields
}

An Item is something we manage in a priority queue.

type PriorityQueue

type PriorityQueue struct {
	sync.Mutex
	// contains filtered or unexported fields
}

A PriorityQueue implements heap.Interface and holds Items.

func NewPriorityQueue

func NewPriorityQueue() *PriorityQueue

NewPriorityQueue create a new PriorityQueue

func (*PriorityQueue) Len

func (pq *PriorityQueue) Len() int

func (*PriorityQueue) Less

func (pq *PriorityQueue) Less(i, j int) bool

func (*PriorityQueue) Pop

func (pq *PriorityQueue) Pop() interface{}

Pop Remove and return the highest item (lowest priority)

func (*PriorityQueue) Push

func (pq *PriorityQueue) Push(x interface{})

Push add a new priority/value pair in the queue. 0 priority = max.

func (*PriorityQueue) Swap

func (pq *PriorityQueue) Swap(i, j int)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL