queue

package
v0.8.12 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2022 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 LKQueue

type LKQueue struct {
	// contains filtered or unexported fields
}

LKQueue is a lock-free unbounded queue. See https://colobu.com/2020/08/14/lock-free-queue-in-go/

func NewLKQueue

func NewLKQueue() *LKQueue

NewLKQueue returns an empty queue.

func (*LKQueue) Dequeue

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

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

func (*LKQueue) Enqueue

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

Enqueue puts the given value v at the tail of the queue.

Jump to

Keyboard shortcuts

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