queue

package
v2.2.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Message

type Message struct {
	// Message is an unstructured, textual representation of the data.
	Message string
	// Ack is a function that may be invoked to (if applicable) signal the
	// underlying messaging system to consider the message delivered and
	// processed.
	Ack func(context.Context) error
}

Message represents a message received from a queue (or similar channel) of some (presumably asynchronous) messaging system.

type Reader

type Reader interface {
	// Read reads a message from a specific queue (or similar channel) known to
	// the implementation. This function blocks until either a successful read or
	// an error occurs.
	Read(ctx context.Context) (*Message, error)
	// Close executes implementation-specific cleanup. Clients MUST invoke this
	// function when they are done with the Reader.
	Close(context.Context) error
}

Reader is an interface used to abstract client code wishing to read messages from a specific queue (or similar channel) of some (presumably asynchronous) messaging system away from the underlying protocols and implementation of the mesaging system in use.

type ReaderFactory

type ReaderFactory interface {
	// NewReader returns an implementation of the Reader interface capable of
	// reading messages from a specific queue (or similar channel) of some
	// (presumably asynchronous) messaging system.
	NewReader(queueName string) (Reader, error)
	// Close executes implementation-specific cleanup. Clients MUST invoke this
	// function when they are done with the ReaderFactory.
	Close(context.Context) error
}

ReaderFactory is an interface for any component that can furnish an implementation of the Reader interface capable of reading messages from a specific queue (or similar channel) of some (presumably asynchronous) messaging system.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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