processor

package
v1.4.2 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2024 License: Apache-2.0 Imports: 11 Imported by: 1 module, 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

View Source
const (
	// GlobalContent provides bytes from a Message.
	GlobalContent = "__content_callback"
	// GlobalMetadata provides the "metadata" function.
	GlobalMetadata = "__metadata_callback"
	// GlobalMessageAddr points to a service.Message
	GlobalMessageAddr = "__message_addr"
)

Variables

This section is empty.

Functions

func NewPythonProcessor added in v1.4.0

func NewPythonProcessor(exe, script string, cnt int, mode python.Mode, logger *service.Logger) (service.BatchProcessor, error)

NewPythonProcessor creates new Python processor instance with the provided configuration.

This will create and initialize a new sub-interpreter from the main Python Go routine and precompile some Python code objects.

Types

type PythonProcessor added in v1.4.0

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

func (*PythonProcessor) Close added in v1.4.0

func (p *PythonProcessor) Close(ctx context.Context) error

Close a processor.

If we're the last Python Processor, ask the main Go routine to stop the runtime.

func (*PythonProcessor) ProcessBatch added in v1.4.0

func (p *PythonProcessor) ProcessBatch(ctx context.Context, batch service.MessageBatch) ([]service.MessageBatch, error)

ProcessBatch executes the given Python script against each message in the batch.

Jump to

Keyboard shortcuts

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