transformerpipeline

package
v0.40.1 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2024 License: MPL-2.0 Imports: 8 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrPipelineClosed = errors.New("pipeline is closed")
)

Functions

This section is empty.

Types

type TransformerPipeline

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

TransformerPipeline runs a pipeline of transform clients.

Ideally we'd just call the result of each transform to the next one, but transformations are not synchronous calls, so orchestration is needed. That's what this does: it hides the orchestration of the transform clients.

Use it like this:

- Construct a new TransformerPipeline with `New`. Give it a context and a slice of transform clients. - Register a callback for transformed records with `OnOutput`. - Start all transformers with `RunBlocking`. - Send records to the pipeline with `Send`. - When done, close the pipeline with `Close`. Otherwise, `RunBlocking` won't finish.

func (*TransformerPipeline) Close

func (lp *TransformerPipeline) Close()

func (*TransformerPipeline) OnOutput

func (lp *TransformerPipeline) OnOutput(fn func([]byte) error) error

func (*TransformerPipeline) RunBlocking

func (lp *TransformerPipeline) RunBlocking() error

func (*TransformerPipeline) Send

func (lp *TransformerPipeline) Send(data []byte) error

Jump to

Keyboard shortcuts

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