queue

package
v0.11.1 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 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 FiFo

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

FiFo implements a first-in-first-out queue backed by the shared queue base.

func (*FiFo) GetLength

func (q *FiFo) GetLength() uint64

GetLength returns the current length guarded by the mutex.

func (*FiFo) GetLength2 added in v0.9.1

func (q *FiFo) GetLength2() uint64

GetLength2 exposes the raw length value without locking.

func (*FiFo[T]) Insert

func (q *FiFo[T]) Insert(items ...*T)

Insert appends the provided items to the tail of the queue.

func (*FiFo) Pop

func (q *FiFo) Pop() (*T, error)

Pop removes and returns the item at the head of the queue.

type LiFo

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

LiFo implements a last-in-first-out stack behaviour.

func (*LiFo) GetLength

func (q *LiFo) GetLength() uint64

GetLength returns the current length guarded by the mutex.

func (*LiFo) GetLength2 added in v0.9.1

func (q *LiFo) GetLength2() uint64

GetLength2 exposes the raw length value without locking.

func (*LiFo[T]) Insert

func (q *LiFo[T]) Insert(items ...*T)

Insert pushes the provided items onto the stack in order.

func (*LiFo) Pop

func (q *LiFo) Pop() (*T, error)

Pop removes and returns the item at the head of the queue.

Source Files

  • fifo.go
  • lifo.go
  • queue.go

Jump to

Keyboard shortcuts

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