queues

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2020 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type InMemory

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

func (*InMemory) Get

func (q *InMemory) Get(ctx context.Context) (Response, error)

func (*InMemory) Publish

func (q *InMemory) Publish(ctx context.Context, msgs ...Message) error

type InMemoryMessage

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

func (*InMemoryMessage) Acknowledgement

func (m *InMemoryMessage) Acknowledgement() error

func (*InMemoryMessage) NegativeAcknowledgement

func (m *InMemoryMessage) NegativeAcknowledgement() error

func (*InMemoryMessage) Value

func (m *InMemoryMessage) Value() interface{}

type Interface

type Interface interface {
	Publisher
	Subscriber
}

type Message

type Message interface {
	Value() interface{}
}

type Publisher

type Publisher interface {
	Publish(ctx context.Context, msgs ...Message) error
}

type Response

type Response interface {
	Message
	Signaler
}

type Signaler

type Signaler interface {
	// Acknowledgement represent a success confirmation back to a caller.
	//
	// For example, in data networking, telecommunications, and computer buses,
	// an acknowledgement (ACK) is a signal that is passed between communicating processes,
	// computers, or devices to signify acknowledgement, or receipt of message, as part of a communications protocol.
	Acknowledgement() error
	// NegativeAcknowledgement represent a signal that tells the caller that the received resource must be considered as not handled,
	// and should be handled over again eventually.
	//
	// The negative-acknowledgement (NAK or NACK) signal is sent to reject a previously received message,
	// or to indicate some kind of error.
	//
	// Acknowledgements and negative acknowledgements inform a sender of the receiver's state
	// so that it can adjust its own state accordingly.
	NegativeAcknowledgement() error
}

Signaler represent communication type of interactions about message state handling.

type Subscriber

type Subscriber interface {
	Get(ctx context.Context) (Response, error)
}

Jump to

Keyboard shortcuts

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