consumer

package
v0.0.0-...-0bbd730 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2018 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Consumer

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

Consumer reads segments from the queue, and replicates merged segments to the rest of the cluster. It's implemented as a state machine: gather segments, replicate, commit, and repeat. All failures invalidate the entire batch.

func New

func New(
	client *http.Client,
	queue queue.Queue,
	log audit.Log,
	frequency time.Duration,
	consumedSegments, consumedRecords metrics.Counter,
	replicatedSegments, replicatedRecords metrics.Counter,
	failedSegments, failedRecords metrics.Counter,
	logger log.Logger,
) *Consumer

New creates a consumer.

func (*Consumer) Run

func (c *Consumer) Run()

Run consumes segments from the queue, and replicates them to the endpoint. Run returns when Stop is invoked.

func (*Consumer) Stop

func (c *Consumer) Stop()

Stop the consumer from consuming.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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