queue

package
v0.0.0-...-78eaa40 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2019 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CQArray

type CQArray struct {
	Items []interface{}
	L     *sync.Mutex
}

CQArray is slice based thread safe queue implementation for concurrent access.

func NewCQArray

func NewCQArray() *CQArray

NewCQArray initializes and returns new CQArray.

func (*CQArray) Len

func (q *CQArray) Len() int

Len returns the item length of queue.

func (*CQArray) Pop

func (q *CQArray) Pop() (n interface{})

Pop returns first item from the queue.

func (*CQArray) Push

func (q *CQArray) Push(n interface{})

Push adds new item tail of the queue.

type CQList

type CQList struct {
	Items *list.List
	L     *sync.Mutex
}

CQList is container/list based thread safe queue implementation for concurrent access.

func NewCQList

func NewCQList() *CQList

NewCQList initializes and returns new CQList.

func (*CQList) Len

func (l *CQList) Len() int

Len returns the item length of queue.

func (*CQList) Pop

func (l *CQList) Pop() (n interface{})

Pop returns first item from the queue.

func (*CQList) Push

func (l *CQList) Push(n interface{})

Push adds new item tail of the queue.

type QArray

type QArray struct {
	Items []interface{}
}

QArray is slice based standard queue implementation without thread safety for concurrent access.

func NewQArray

func NewQArray() *QArray

NewQArray initializes and returns new QArray.

func (*QArray) Len

func (q *QArray) Len() int

Len returns the item length of queue.

func (*QArray) Pop

func (q *QArray) Pop() (n interface{})

Pop returns first item from the queue.

func (*QArray) Push

func (q *QArray) Push(n interface{})

Push adds new item tail of the queue.

type QList

type QList struct {
	Items *list.List
}

QList is container/list based standard queue implementation without thread safety for concurrent access.

func NewQList

func NewQList() *QList

NewQList initializes and returns new QList.

func (*QList) Len

func (l *QList) Len() int

Len returns the item length of queue.

func (*QList) Pop

func (l *QList) Pop() (n interface{})

Pop returns first item from the queue.

func (*QList) Push

func (l *QList) Push(n interface{})

Push adds new item tail of the queue.

Jump to

Keyboard shortcuts

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