priority_chan

package module
v0.0.0-...-ea23427 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrClosed = errors.New("PriorityChannel Closed")
)

Functions

This section is empty.

Types

type Prioritor

type Prioritor interface {
	Priority() uint64
}

type PriorityChannel

type PriorityChannel struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

PriorityChannel as implemented by a min heap ie. the 0th element is the *lowest* value.

func New

func New(capacity int) *PriorityChannel

New creates a PriorityChannel of the given capacity.

func (*PriorityChannel) Close

func (pc *PriorityChannel) Close()

func (*PriorityChannel) Len

func (pc *PriorityChannel) Len() int

Len return length of priority queue

func (*PriorityChannel) Put

func (pc *PriorityChannel) Put(val Prioritor) error

func (*PriorityChannel) Reader

func (pc *PriorityChannel) Reader() <-chan Prioritor

func (*PriorityChannel) Swap

Jump to

Keyboard shortcuts

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