mixedbatchwriter

package
v4.2.1-rc1 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2023 License: MPL-2.0 Imports: 6 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	MigrateTableBatch(ctx context.Context, messages []*message.WriteMigrateTable) error
	InsertBatch(ctx context.Context, messages []*message.WriteInsert) error
	DeleteStaleBatch(ctx context.Context, messages []*message.WriteDeleteStale) error
}

Client is a client that will receive batches of messages with a mixture of tables.

type MixedBatchWriter

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

func New

func New(client Client, opts ...Option) (*MixedBatchWriter, error)

func (*MixedBatchWriter) Write

func (w *MixedBatchWriter) Write(ctx context.Context, msgChan <-chan message.WriteMessage) error

Write starts listening for messages on the msgChan channel and writes them to the client in batches.

type Option

type Option func(writer *MixedBatchWriter)

func WithBatchSize

func WithBatchSize(size int) Option

func WithBatchSizeBytes

func WithBatchSizeBytes(size int) Option

func WithBatchTimeout

func WithBatchTimeout(timeout time.Duration) Option

func WithLogger

func WithLogger(logger zerolog.Logger) Option

Jump to

Keyboard shortcuts

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