batch

package
v0.13.1 Latest Latest
Warning

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

Go to latest
Published: May 30, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrShuttingDown = errors.New("shutting down")

Functions

This section is empty.

Types

type Batch

type Batch interface {
	CanAdd(any) bool
	Add(any)
	Size() int
	Complete()
	Fail(error)
}

type Batcher

type Batcher interface {
	io.Closer
	Add(request any)
	Run()
}

type BatcherFactory

type BatcherFactory struct {
	Linger              time.Duration
	MaxRequestsPerBatch int
}

func (*BatcherFactory) NewBatcher

func (b *BatcherFactory) NewBatcher(ctx context.Context, shard int64, batcherType string, batchFactory func() Batch) Batcher

Jump to

Keyboard shortcuts

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