batcher

package
v0.0.0-...-20ca37a Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2024 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Batcher

type Batcher struct {
	Do       func(ctx context.Context, val map[string][]interface{})
	Sharding func(key string) int
	// contains filtered or unexported fields
}

func New

func New(opts ...Option) *Batcher

func (*Batcher) Add

func (b *Batcher) Add(key string, val interface{}) error

func (*Batcher) Close

func (b *Batcher) Close()

func (*Batcher) Start

func (b *Batcher) Start()

type Option

type Option interface {
	// contains filtered or unexported methods
}

func WithBuffer

func WithBuffer(b int) Option

func WithInterval

func WithInterval(i time.Duration) Option

func WithSize

func WithSize(s int) Option

func WithWorker

func WithWorker(w int) Option

Jump to

Keyboard shortcuts

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