queue

package
v0.0.0-...-1f4ee57 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Delay

func Delay(z int)

Types

type EsQueue

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

lock free queue

func NewEsQueue

func NewEsQueue(capaciity uint32) *EsQueue

func (*EsQueue) Capaciity

func (q *EsQueue) Capaciity() uint32

func (*EsQueue) Get

func (q *EsQueue) Get() (val interface{}, ok bool, quantity uint32)

get queue functions

func (*EsQueue) Gets

func (q *EsQueue) Gets(values []interface{}) (gets, quantity uint32)

gets queue functions

func (*EsQueue) Put

func (q *EsQueue) Put(val interface{}) (ok bool, quantity uint32)

put queue functions

func (*EsQueue) Puts

func (q *EsQueue) Puts(values []interface{}) (puts, quantity uint32)

puts queue functions

func (*EsQueue) Quantity

func (q *EsQueue) Quantity() uint32

func (*EsQueue) String

func (q *EsQueue) String() string

type Item

type Item interface {
	Less(Item) bool
}

type ListQueue

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

func NewListQueue

func NewListQueue(size int) *ListQueue

type Node

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

func (*Node) Next

func (n *Node) Next() *Node

func (*Node) Previous

func (n *Node) Previous() *Node

func (*Node) Set

func (n *Node) Set(value interface{})

func (*Node) Value

func (n *Node) Value() interface{}

type Queue

type Queue interface {
	// 获取当前链表长度。
	Len() int
	// 获取当前链表容量。
	Capacity() int
	// 获取当前链表头结点。
	Front() *Node
	// 获取当前链表尾结点。
	Rear() *Node
	// 入列。
	Enqueue(value interface{}) bool
	// 出列。
	Dequeue() interface{}
}

type RingQueue

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

func NewRingQueue

func NewRingQueue(capacity int) *RingQueue

func (*RingQueue) Capacity

func (q *RingQueue) Capacity() int

func (*RingQueue) Dequeue

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

func (*RingQueue) Enqueue

func (q *RingQueue) Enqueue(value interface{}) bool

func (*RingQueue) Front

func (q *RingQueue) Front() interface{}

func (*RingQueue) IsFull

func (q *RingQueue) IsFull() bool

IsFull checks if the ring buffer is full

func (*RingQueue) Length

func (q *RingQueue) Length() int

func (*RingQueue) LookAll

func (q *RingQueue) LookAll() []interface{}

LookAll reads all elements from ring buffer this method doesn't consume all elements

func (*RingQueue) Tail

func (q *RingQueue) Tail() interface{}

type TinyQueue

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

func New

func New(data []Item) *TinyQueue

func (*TinyQueue) Len

func (q *TinyQueue) Len() int

func (*TinyQueue) Peek

func (q *TinyQueue) Peek() Item

func (*TinyQueue) Pop

func (q *TinyQueue) Pop() Item

func (*TinyQueue) Push

func (q *TinyQueue) Push(item Item)

Jump to

Keyboard shortcuts

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