queue

package
v0.0.0-...-05fba6c Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2022 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 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)

	// Len returns length of the underlying queue
	Len() int

	// WaitForItem waut 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 NewConcurrentQueue

func NewConcurrentQueue() Queue

Jump to

Keyboard shortcuts

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