batcher

package
v0.22.0 Latest Latest
Warning

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

Go to latest
Published: May 7, 2024 License: Apache-2.0 Imports: 3 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[K comparable, V any] struct {
	// contains filtered or unexported fields
}

func NewBatcher

func NewBatcher[K comparable, V any](config Config[K, V]) *Batcher[K, V]

func (*Batcher[K, V]) Queue

func (b *Batcher[K, V]) Queue(key K, value V)

type Config

type Config[K comparable, V any] struct {
	Context      context.Context
	MaxBatchSize int
	Interval     time.Duration
	Process      func(context.Context, K, []V)
}

Jump to

Keyboard shortcuts

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