queue

package
v0.5.5 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2023 License: Apache-2.0 Imports: 3 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CQueue

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

CQueue is a concurrent unbounded queue which uses two-Lock concurrent queue qlgorithm.

func NewCQueue

func NewCQueue() *CQueue

NewCQueue returns an empty CQueue.

func (*CQueue) Dequeue

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

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

func (*CQueue) Enqueue

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

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

type LKQueue

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

func NewLKQueue

func NewLKQueue() *LKQueue

func (*LKQueue) Dequeue

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

func (*LKQueue) Enqueue

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

type SliceQueue

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

SliceQueue is an unbounded queue which uses a slice as underlying.

func NewSliceQueue

func NewSliceQueue(n int) (q *SliceQueue)

NewSliceQueue returns an empty queue. You can give a

func (*SliceQueue) Dequeue

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

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

func (*SliceQueue) Enqueue

func (q *SliceQueue) 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