memory

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2024 License: EPL-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Queue

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

Queue - basic memory based queue

func New

func New() *Queue

New creates a new memory-based queue

func (*Queue) Enqueue

func (q *Queue) Enqueue(p io.Reader) error

Enqueue add item to the queue.

func (*Queue) Leave

func (q *Queue) Leave() error

Leave implements Entry.Leave - the entry (will be returned on subsequent calls to Peek)

func (*Queue) Peek

func (q *Queue) Peek() (queue.Entry, error)

Peek retrieves the oldest item from the queue (without removing it)

func (*Queue) Quarantine

func (q *Queue) Quarantine() error

Quarantine implements Entry.Quarantine - Flag that this entry has an error (remove from queue, potentially retaining data with error flagged)

func (*Queue) Reader

func (q *Queue) Reader() (io.Reader, error)

Reader implements Entry.Reader - As the entry will always be the first item in the queue this is implemented against Queue rather than as a separate struct.

func (*Queue) Remove

func (q *Queue) Remove() error

Remove implements Entry.Remove this entry from the queue

func (*Queue) Wait

func (q *Queue) Wait() chan struct{}

Wait returns a channel that is closed when there is something in the queue

func (*Queue) WaitForEmpty

func (q *Queue) WaitForEmpty() chan struct{}

WaitForEmpty returns a channel which will be closed when the queue is empty

Jump to

Keyboard shortcuts

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