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.
Click to show internal directories.
Click to hide internal directories.