queue

package
v0.13.0-alpha.109 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Queue

type Queue[T comparable] struct {
	// contains filtered or unexported fields
}

Queue is a generic Queue implementation.

func NewQueue

func NewQueue[T comparable]() *Queue[T]

func (*Queue[T]) Add

func (q *Queue[T]) Add(item T)

func (*Queue[T]) Get

func (q *Queue[T]) Get() (t T, ok bool)

func (*Queue[T]) GetOrWait

func (q *Queue[T]) GetOrWait() T

func (*Queue[T]) GetOrWaitWithDone

func (q *Queue[T]) GetOrWaitWithDone(done <-chan struct{}) (T, bool)

func (*Queue[T]) Len

func (q *Queue[T]) Len() int

func (*Queue[T]) Remove

func (q *Queue[T]) Remove(item T) bool

type WeightQueue

type WeightQueue[T comparable] struct {
	// contains filtered or unexported fields
}

func NewWeightQueue

func NewWeightQueue[T comparable]() *WeightQueue[T]

func (*WeightQueue[T]) AddWeight

func (q *WeightQueue[T]) AddWeight(item T, weight int) <-chan struct{}

func (*WeightQueue[T]) Get

func (q *WeightQueue[T]) Get() (T, int, func(), bool)

func (*WeightQueue[T]) GetOrWaitWithDone

func (q *WeightQueue[T]) GetOrWaitWithDone(done <-chan struct{}) (T, int, func(), bool)

func (*WeightQueue[T]) Len

func (q *WeightQueue[T]) Len() int

Jump to

Keyboard shortcuts

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