transaction

package
v3.44.0 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Tracked

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

Tracked is a transaction type that adds identifying tags to messages such that an error returned resulting from multiple transaction messages can be reduced.

func NewTracked

func NewTracked(msg types.Message, resChan chan<- types.Response) *Tracked

NewTracked creates a transaction from a message batch and a response channel. The message is tagged with an identifier for the transaction, and if an error is returned from a downstream component that merged messages from other transactions the tag can be used in order to determine whether the message owned by this transaction succeeded.

func (*Tracked) Ack

func (t *Tracked) Ack(ctx context.Context, err error) error

Ack provides a response to the upstream service from an error.

func (*Tracked) Message

func (t *Tracked) Message() types.Message

Message returns the message owned by this transaction.

func (*Tracked) ResponseChan

func (t *Tracked) ResponseChan() chan<- types.Response

ResponseChan returns the response channel owned by this transaction.

Jump to

Keyboard shortcuts

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