batching

package
v0.0.0-...-c6fb7fd Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2024 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Batch

func Batch[T any](batchSize int, data []T, eachFn func([]T) error) error

Batch splits values in `data` in batches of size `batchSize`, and calls `eachFn` for each batch.

func BatchMap

func BatchMap[T any](batchSize int, data map[string][]T, eachFn func(map[string][]T) error) error

BatchMap splits values in `data` in batches of size `batchSize`, and calls `eachFn` for each batch. Values of a specific key may be split into different batches, make sure `eachFn` can handle that case.

Types

This section is empty.

Jump to

Keyboard shortcuts

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