pubsub

package
v0.0.0-...-4515e61 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2019 License: AGPL-3.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 Consumer

type Consumer interface {
	Consume(context.Context, HandlerFunc) error
}

Consumer of messages from a message queue

type HandlerFunc

type HandlerFunc func(ctx context.Context, msg Message) error

HandlerFunc for the consumer

type Message

type Message interface {
	// Ack nowledges and accepts a message
	Ack()
	// Nack (not acklowdges) a message and requeue it
	Nack()
	// Data returns the byte data of a message
	Data() []byte
}

Message of an event. The message has to be abstracted to be used in an business environment, so that a possible switch to a different message queue is possible in the future.

type Producer

type Producer interface {
	Produce(ctx context.Context, data []byte) error
}

Producer interface for message queue implementation

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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