type Batcher[T any] struct {
// contains filtered or unexported fields
}
Batcher is a utility that batches items together and then invokes the provided function
on that whenever it reaches the specified size or the timeout is reached.
New creates a new Batcher that will invoke the provided function when the batch size is reached.
The size is the maximum number of items that can be batched before processing the batch.
The timeout is the duration that will be waited before processing the batch.