batch

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: Apache-2.0 Imports: 5 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(batchFactory func() Batch) Batcher

Jump to

Keyboard shortcuts

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