batching

package
v0.0.0-...-3ce1eab Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2019 License: Apache-2.0, BSD-3-Clause, MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type V2EnvelopeBatcher

type V2EnvelopeBatcher struct {
	*batching.Batcher
}

V2EnvelopeBatcher batches slices of bytes.

func NewV2EnvelopeBatcher

func NewV2EnvelopeBatcher(size int, interval time.Duration, writer V2EnvelopeWriter) *V2EnvelopeBatcher

NewV2EnvelopeBatcher creates a new ByteBatcher.

func (*V2EnvelopeBatcher) Write

func (b *V2EnvelopeBatcher) Write(data *loggregator_v2.Envelope)

Write stores data to the batch. It will not submit the batch to the writer until either the batch has been filled, or the interval has lapsed. NOTE: Write is *not* thread safe and should be called by the same goroutine that calls Flush.

type V2EnvelopeWriter

type V2EnvelopeWriter interface {
	// Write submits the batch.
	Write(batch []*loggregator_v2.Envelope)
}

V2EnvelopeWriter is used to submit the completed batch of v2 envelopes. The batch may be partial if the interval lapsed instead of filling the batch.

type V2EnvelopeWriterFunc

type V2EnvelopeWriterFunc func(batch []*loggregator_v2.Envelope)

V2EnvelopeWriterFunc is an adapter to allow ordinary functions to be a V2EnvelopeWriter.

func (V2EnvelopeWriterFunc) Write

func (f V2EnvelopeWriterFunc) Write(batch []*loggregator_v2.Envelope)

Write implements V2EnvelopeWriter.

Jump to

Keyboard shortcuts

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