chanx

package
v0.4.3 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Batch

func Batch[T any](ctx context.Context, ch <-chan T, batchSize int, fn func([]T))

Batch reads from a channel and calls fn with a slice of batchSize.

func BatchFilter added in v0.2.0

func BatchFilter[T, V any](ctx context.Context, ch <-chan T, batchSize int, filter func(T) V, fn func([]V))

BatchFilter reads from a channel, filters values, and calls fn with a slice of batchSize.

func FlatBatch

func FlatBatch[T any](ctx context.Context, ch <-chan []T, batchSize int, fn func([]T))

FlatBatch reads from a channel of slices, flats values, and calls fn with a slice of batchSize.

func FlatBatchFilter added in v0.2.0

func FlatBatchFilter[T, V any](ctx context.Context, ch <-chan []T, batchSize int, filter func(T) V, fn func([]V))

FlatBatchFilter reads from a channel of slices, flats values, filters values, and calls fn with a slice of batchSize.

Types

This section is empty.

Jump to

Keyboard shortcuts

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