prioqueue

package
v3.0.0-rc58 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2026 License: Apache-2.0 Imports: 1 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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