Versions in this module Expand all Collapse all v0 v0.1.0 Jul 23, 2026 Changes in this version + var ErrClosed = errors.New("batchgo: closed") + var ErrQueueFull = errors.New("batchgo: queue full") + type Batcher struct + func New[T any](cfg Config, handler Handler[T]) (*Batcher[T], error) + func (b *Batcher[T]) Add(ctx context.Context, item T) error + func (b *Batcher[T]) Close(ctx context.Context) error + func (b *Batcher[T]) Done() <-chan struct{} + func (b *Batcher[T]) DroppedErrors() uint64 + func (b *Batcher[T]) Errors() <-chan error + func (b *Batcher[T]) Flush(ctx context.Context) error + func (b *Batcher[T]) TryAdd(item T) error + type Config struct + ErrorQueueSize int + MaxSize int + MaxWait time.Duration + QueueSize int + Workers int + type Handler func(context.Context, []T) error + type PanicError struct + Stack []byte + Value any + func (e *PanicError) Error() string