processor

package
v1.6.1 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

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, modules []string, cnt int, mode python.Mode, serializer python.SerializerMode,
	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