queue

package
v0.1.8-alpha.4 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2019 License: GPL-3.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 Item

type Item interface {
	ID() interface{}
}

Item represents a queue item

type Queue

type Queue struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

Queue wraps lane.Deque which is a head-tail linked list. It maintains an index of items contained in the queue

func New

func New() *Queue

New creates an instance of Queue

func (*Queue) Append

func (q *Queue) Append(i Item)

Append appends an item to the queue

func (*Queue) Empty

func (q *Queue) Empty() bool

Empty checks whether the queue is empty

func (*Queue) Has

func (q *Queue) Has(i Item) bool

Has checks whether a item exist in the queue

func (*Queue) Head

func (q *Queue) Head() Item

Head get an item from the head of the queue

func (*Queue) Size

func (q *Queue) Size() int

Size returns the size of the queue

Jump to

Keyboard shortcuts

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