batchaggregator

package
v1.13.1 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Aggregator

type Aggregator struct {
	// contains filtered or unexported fields
}

Aggregator aggregates batch items to reduce round trips.

func New

func New(batcher metaclient.Batcher) *Aggregator

New returns a new aggregator that will aggregate batch items to be issued by the batcher.

func (*Aggregator) Flush

func (a *Aggregator) Flush(ctx context.Context) (err error)

Flush issues all scheduled batch items.

func (*Aggregator) Schedule

func (a *Aggregator) Schedule(batchItem metaclient.BatchItem)

Schedule schedules a batch item to be issued at the next flush.

func (*Aggregator) ScheduleAndFlush

func (a *Aggregator) ScheduleAndFlush(ctx context.Context, batchItem metaclient.BatchItem) (_ *metaclient.BatchResponse, err error)

ScheduleAndFlush schedules a batch item and immediately issues all scheduled batch items. It returns the response to the batch item scheduled with the call.

Jump to

Keyboard shortcuts

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