processor

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KafkaMetricProcessor

type KafkaMetricProcessor struct {
	io.Closer
	// contains filtered or unexported fields
}

func NewMetricProcessor

func NewMetricProcessor(params *MetricProcessorParams) *KafkaMetricProcessor

func (*KafkaMetricProcessor) Process

func (s *KafkaMetricProcessor) Process(message Message) error

Process unmarshals and writes a single kafka message

type Message

type Message interface {
	Value() []byte
}

type MetricProcessor

type MetricProcessor interface {
	Process(input Message) error
	io.Closer
}

func NewDecoratedProcessor

func NewDecoratedProcessor(f metrics.Factory, processor MetricProcessor) MetricProcessor

NewDecoratedProcessor returns a processor with metrics

type MetricProcessorParams

type MetricProcessorParams struct {
	Writer       metricstore.Writer
	Unmarshaller kafka.Unmarshaller
}

type ParallelProcessor

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

ParallelProcessor is a processor that processes in parallel using a pool of goroutines

func NewParallelProcessor

func NewParallelProcessor(
	processor MetricProcessor,
	parallelism int,
	logger *zap.Logger) *ParallelProcessor

NewParallelProcessor creates a new parallel processor

func (*ParallelProcessor) Close

func (k *ParallelProcessor) Close() error

Close terminates all running goroutines

func (*ParallelProcessor) Process

func (k *ParallelProcessor) Process(message Message) error

Process queues a message for processing

func (*ParallelProcessor) Start

func (k *ParallelProcessor) Start()

Start begins processing queued messages

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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