prioqueue

package
v3.0.0-rc19 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2026 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package prioqueue implements a priority queue using a heap-based implementation.

Items are ordered according to the Interface.Before method. The queue is a min-heap: items for which Before returns true come first. This means lower priority values (as defined by the Before implementation) are popped before higher values.

For example, the daemon/runner implements:

func (a *MyItem) Before(b prioqueue.Interface) bool {
    return a.Priority < b.(*MyItem).Priority
}

Then an item with Priority=1 will be popped before an item with Priority=2.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Interface

type Interface interface {
	Before(Interface) bool
}

type Queue

type Queue struct {
	// contains filtered or unexported fields
}

func New

func New() *Queue

func (*Queue) Len

func (pq *Queue) Len() int

func (*Queue) Pop

func (pq *Queue) Pop() Interface

func (*Queue) Push

func (pq *Queue) Push(something Interface)

Jump to

Keyboard shortcuts

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