queue

package
v0.0.0-...-0d0b246 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2019 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrEmptyQueue is returned when queue is empty.
	ErrEmptyQueue = errors.New("queue is empty")
)

Functions

This section is empty.

Types

type Queue

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

Queue is data structure, which has much similar behavior with channel.

func New

func New(ctx context.Context) *Queue

New create a new Queue

func (*Queue) Get

func (q *Queue) Get() (interface{}, error)

Get gets an element from Queue.

func (*Queue) IsEmpty

func (q *Queue) IsEmpty() bool

IsEmpty returns true if Queue is empty.

func (*Queue) Put

func (q *Queue) Put(val interface{})

Put puts an element into Queue.

func (*Queue) Size

func (q *Queue) Size() int

Size returns the size of Queue.

Jump to

Keyboard shortcuts

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