queue

package
v0.0.0-...-7148df5 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConcurrentQueue

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

ConcurrentQueue - A queue which is go-routine safe

func (*ConcurrentQueue) Dequeue

func (mq *ConcurrentQueue) Dequeue() (interface{}, bool)

func (*ConcurrentQueue) Enqueue

func (mq *ConcurrentQueue) Enqueue(item interface{})

func (*ConcurrentQueue) Len

func (mq *ConcurrentQueue) Len() int

func (*ConcurrentQueue) WaitForItem

func (mq *ConcurrentQueue) WaitForItem() interface{}

type Queue

type Queue interface {
	// EnQueue an element to the queue
	Enqueue(item interface{})
	// DeQueue an element from the queue
	Dequeue() (interface{}, bool)
	// Return the length of the underlying queue
	Len() int
	// Wait until an item in the underlying queue is ready
	// Once an item is available. Dequeue this item and return it
	WaitForItem() interface{}
}

Queue - An interface to queues

func NewQueue

func NewQueue() Queue

Jump to

Keyboard shortcuts

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