consumer

package
v0.0.0-...-132c30d Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2023 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrConsumeDB               = errors.New("could not write in DB")
	ErrConsumeMsg              = errors.New("message taken into account, but service temporily unavailable")
	ErrUnexpectedMessageStatus = errors.New("unexpected message status")
)

Functions

func DefaultSettings

func DefaultSettings() *viper.Viper

DefaultSettings returns all defaults for this package as a viper register.

This is primarily intended for documentation & help purpose.

Types

type Consumer

type Consumer struct {
	ID string
	// contains filtered or unexported fields
}

func New

func New(rt injected.Runtime, id string) *Consumer

func (Consumer) Logger

func (p Consumer) Logger() log.Factory

func (*Consumer) Start

func (p *Consumer) Start() error

func (*Consumer) Stop

func (p *Consumer) Stop() error

type DummyProcessor

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

DummyProcessor processes messages with some random behavior for testing purpose.

func NewDummyProcessor

func NewDummyProcessor(rt injected.Runtime) *DummyProcessor

func (DummyProcessor) Process

func (p DummyProcessor) Process(ctx context.Context, msg *repos.Message) error

Process a message with some random behavior.

Notice that this does not interact with the database, primarily owned by the producer node.

type MessageProcessor

type MessageProcessor interface {
	Process(context.Context, *repos.Message) error
}

MessageProcessor knows how to process a message.

Jump to

Keyboard shortcuts

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