Documentation
¶
Overview ¶
Package chanutil implements methods for working with channels.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Batch ¶
func Batch[T any](in <-chan T, options ...BatchOption) <-chan []T
Batch returns a new channel that consumes all the items from `in` and batches them together.
Types ¶
type BatchOption ¶
type BatchOption func(cfg *batchConfig)
A BatchOption customizes a batch operation.
func WithBatchMaxSize ¶
func WithBatchMaxSize(maxSize int) BatchOption
WithBatchMaxSize sets the maximum batch size for a Batch operation.
func WithBatchMaxWait ¶
func WithBatchMaxWait(maxWait time.Duration) BatchOption
WithBatchMaxWait sets the maximum wait duration for a Batch operation.
Click to show internal directories.
Click to hide internal directories.