queue

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New[Value any](opts ...options.Option[Queue[Value]]) core.Queue[Value]

func WithCapacity added in v0.0.2

func WithCapacity[Value any](c int) options.Option[Queue[Value]]

Types

type Queue

type Queue[Value any] struct {
	// contains filtered or unexported fields
}

Queue is a lock-free queue implemented with linked list, based on atomic compare-and-swap operations.

func (*Queue[Value]) Dequeue

func (q *Queue[Value]) Dequeue() (Value, bool)

func (*Queue[Value]) Empty

func (q *Queue[Value]) Empty() bool

func (*Queue[Value]) Enqueue

func (q *Queue[Value]) Enqueue(v Value) bool

func (*Queue[Value]) Full

func (q *Queue[Value]) Full() bool

func (*Queue[Value]) Range

func (q *Queue[Value]) Range(iterator func(val Value) bool)

func (*Queue[Value]) Size

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

Jump to

Keyboard shortcuts

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