file

package
v0.21.0 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2024 License: EPL-2.0 Imports: 7 Imported by: 1

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 file based queue

func New

func New(path string, prefix string, extension string) (*Queue, error)

New creates a new file-based queue. Note that a file is written, read and deleted as part of this process to check that the path is usable. NOTE: Order is maintained using file ModTime, so there may be issues if the interval between messages is less than the file system ModTime resolution.

func (*Queue) Enqueue

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

Enqueue add item to the queue.

func (*Queue) Peek

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

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

func (*Queue) Wait

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

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

func (*Queue) WaitForEmpty

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

WaitForEmpty returns a channel that is closed when the queue is empty

Jump to

Keyboard shortcuts

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