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.
Click to show internal directories.
Click to hide internal directories.