buffered_queue

package
v0.0.0-...-45e1a9a Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BufferedQueue

type BufferedQueue[T any] struct {
	// contains filtered or unexported fields
}

BufferedQueue implements a buffered queue using a linked list of job chunks

func NewBufferedQueue

func NewBufferedQueue[T any](chunkSize int) *BufferedQueue[T]

NewBufferedQueue creates a new buffered queue with the specified chunk size

func (*BufferedQueue[T]) CloseInput

func (q *BufferedQueue[T]) CloseInput()

func (*BufferedQueue[T]) Dequeue

func (q *BufferedQueue[T]) Dequeue() (T, bool)

Dequeue removes and returns a job from the queue

func (*BufferedQueue[T]) Enqueue

func (q *BufferedQueue[T]) Enqueue(job T) error

Enqueue adds a job to the queue

func (*BufferedQueue[T]) IsEmpty

func (q *BufferedQueue[T]) IsEmpty() bool

IsEmpty returns true if the queue is empty

func (*BufferedQueue[T]) PeekHead

func (q *BufferedQueue[T]) PeekHead() (T, bool)

func (*BufferedQueue[T]) Size

func (q *BufferedQueue[T]) Size() int

Size returns the number of items in the queue

type ItemChunkNode

type ItemChunkNode[T any] struct {
	// contains filtered or unexported fields
}

ItemChunkNode represents a node in the linked list of job chunks

Jump to

Keyboard shortcuts

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