prque

package
v0.15.45 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2025 License: GPL-3.0, LGPL-3.0 Imports: 0 Imported by: 3

Documentation

Overview

Package prque provides wrapper types for go-ethereum's prque implementation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LazyQueue

type LazyQueue[P comparable, V any] struct {
	// contains filtered or unexported fields
}

LazyQueue is a wrapper for go-ethereum's LazyQueue

func NewLazyQueue

func NewLazyQueue[P comparable, V any](setIndexCallback func(data V, index int), priorityCallback func(data V) P, maxPriority func(data V, priority P) P, clock func() P, maxQueued int) *LazyQueue[P, V]

NewLazyQueue creates a new lazy queue - simplified version

type Prque

type Prque[P comparable, V any] struct {
	// contains filtered or unexported fields
}

Prque is a wrapper for go-ethereum's Prque

func New

func New[P comparable, V any](setIndexCallback func(data V, index int)) *Prque[P, V]

New creates a new priority queue - simplified version

func (*Prque[P, V]) Empty

func (p *Prque[P, V]) Empty() bool

Empty returns true if queue is empty

func (*Prque[P, V]) Peek

func (p *Prque[P, V]) Peek() (V, P)

Peek returns the top item without removing it

func (*Prque[P, V]) Pop

func (p *Prque[P, V]) Pop() (V, P)

Pop removes and returns the top item with its priority

func (*Prque[P, V]) PopItem

func (p *Prque[P, V]) PopItem() V

PopItem removes and returns the top item

func (*Prque[P, V]) Push

func (p *Prque[P, V]) Push(data V, priority P)

Push adds an item to the queue

Jump to

Keyboard shortcuts

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