queue

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2020 License: Apache-2.0 Imports: 3 Imported by: 0

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