queue

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2026 License: MIT Imports: 2 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 any] struct {
	// contains filtered or unexported fields
}

Queue A simple thread safe resizable queue.

func NewQueue

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

func (*Queue[T]) Back

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

Back return the element in the back of the queue

func (*Queue[T]) Count

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

Count return the current element count in the queue

func (*Queue[T]) Elems

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

Elems return a copy of the queue.

func (*Queue[T]) Front

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

Front return the element in th front of the queue

func (*Queue[T]) Pop

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

Pop pop the front element and return

func (*Queue[T]) Push

func (q *Queue[T]) Push(elem T)

Push push the element at the back the queue

func (*Queue[T]) Size

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

Size return current size of the queue

type QueueChannel

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

func NewQueueChannel

func NewQueueChannel[T any](size int) *QueueChannel[T]

func NewQueueChannelFromChan

func NewQueueChannelFromChan[T any](ch chan T) *QueueChannel[T]

func (*QueueChannel[T]) Chan

func (q *QueueChannel[T]) Chan() chan T

func (*QueueChannel[T]) Push

func (q *QueueChannel[T]) Push(elem T)

func (*QueueChannel[T]) Size

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

func (*QueueChannel[T]) Stop

func (q *QueueChannel[T]) Stop()

Jump to

Keyboard shortcuts

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