queue

package
v1.14.0 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrDisposed is returned when an operation is performed on a disposed
	// queue.
	ErrDisposed = errors.New(`queue: disposed`)

	// ErrTimeout is returned when an applicable queue operation times out.
	ErrTimeout = errors.New(`queue: poll timed out`)

	// ErrEmptyQueue is returned when an non-applicable queue operation was called
	// due to the queue's empty item state
	ErrEmptyQueue = errors.New(`queue: empty queue`)
)

Functions

This section is empty.

Types

type Queue

type Queue interface {
	// Put put items to queue
	Put(items ...interface{}) error
	// Get batch get items from queue
	Get(number int64, items []interface{}) (int64, error)
	// Dispose dispose queue
	Dispose() []interface{}
	// Disposed returns a bool indicating if this queue
	// has had disposed called on it.
	Disposed() bool
}

Queue queue

func New

func New(hint int64) Queue

New is a constructor for a new threadsafe queue.

Jump to

Keyboard shortcuts

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