buffering

package
v2.4.1 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2021 License: Apache-2.0 Imports: 8 Imported by: 3

Documentation

Overview

Package buffering provides APIs for buffered messages.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BufferMessage

func BufferMessage(ctx context.Context, m binding.Message, transformers ...binding.Transformer) (binding.Message, error)

BufferMessage works the same as CopyMessage and it also bounds the original Message lifecycle to the newly created message: calling Finish() on the returned message calls m.Finish(). transformers can be nil and this function guarantees that they are invoked only once during the encoding process.

func CopyMessage

func CopyMessage(ctx context.Context, m binding.Message, transformers ...binding.Transformer) (binding.Message, error)

CopyMessage reads m once and creates an in-memory copy depending on the encoding of m. The returned copy is not dependent on any transport and can be visited many times. When the copy can be forgot, the copied message must be finished with Finish() message to release the memory. transformers can be nil and this function guarantees that they are invoked only once during the encoding process.

func WithAcksBeforeFinish

func WithAcksBeforeFinish(m binding.Message, requiredAcks int) binding.Message

WithAcksBeforeFinish returns a wrapper for m that calls m.Finish() only after the specified number of acks are received. Use it when you need to dispatch a Message using several Sender instances

Types

This section is empty.

Jump to

Keyboard shortcuts

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