priorityqueue

package
v3.2.1 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2023 License: MIT Imports: 0 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Item

type Item interface {
	// ID returns a unique identifier for the item
	ID() string
	// Priority returns the priority level used to sort the item
	Priority() int64
	// Body returns the payload associated with the item
	Body() []byte
	// Context returns any meta-information associated with the item
	Context() ([]byte, error)
}

Item represents a binary heap item

type Queue

type Queue interface {
	// Insert adds an item to the queue
	Insert(item Item)
	// ExtractMin returns the item with the lowest priority
	ExtractMin() Item
	// Len returns the number of items in the queue
	Len() uint64
}

Queue is a binary heap interface

Jump to

Keyboard shortcuts

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