queue

package
v0.0.0-...-6b870f6 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2014 License: BSD-2-Clause Imports: 0 Imported by: 0

Documentation

Index

Constants

View Source
const MAX_ITEMS_PER_CHUNK = 4096

Variables

This section is empty.

Functions

This section is empty.

Types

type ChunkedQueue

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

a queue made out of list of chunk elements

func New

func New() *ChunkedQueue

create a new queue

func (*ChunkedQueue) Empty

func (CQ *ChunkedQueue) Empty() bool

func (*ChunkedQueue) Len

func (CQ *ChunkedQueue) Len() int32

func (*ChunkedQueue) Pop

func (CQ *ChunkedQueue) Pop() (item Data)

this function is called to remove an item from the head of the queue. when the number of items contained in a chunk drops to 0, it is removed from the queue

func (*ChunkedQueue) Push

func (CQ *ChunkedQueue) Push(item Data)

this function is called to add an item to the end of the queue. grow the queue by a chunk if required.

type Data

type Data interface{}

Jump to

Keyboard shortcuts

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