collection

package
v2.10.0 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2024 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 struct {
	// contains filtered or unexported fields
}

Queue defines a lock-free Queue.

func NewQueue

func NewQueue() *Queue

NewQueue creates and returns a new lock-free queue.

func (*Queue) Dequeue

func (q *Queue) Dequeue() interface{}

Dequeue removes and returns the value at the head of the queue. It returns nil if the queue is empty.

func (*Queue) Enqueue

func (q *Queue) Enqueue(v interface{})

Enqueue adds a value to the tail of the queue.

func (*Queue) IsEmpty

func (q *Queue) IsEmpty() bool

IsEmpty returns true when the queue is empty

func (*Queue) Length

func (q *Queue) Length() uint64

Length returns the number of items in the queue.

Jump to

Keyboard shortcuts

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