Skip to main content

processor


id: py-processor

processor

const processor: Processor

The current processor instance. Provides access to ports, arguments, logging, and processor-specific configuration.


At a Glance

def on_init():
# Resolve output port once at init
global OUTPUT_PORT
OUTPUT_PORT = processor.getOutputPort('Output')

def on_message():
# Log with processor context
processor.logInfo(f'Processing message {message.id}')

# Access custom arguments
args = processor.getArguments()
timeout = args.get('timeoutMs', 5000)

# Expand environment variables in strings
path = processor.expandString('${lay:DATA_DIR}/input.csv')

Common Tasks

TaskMethod
Get output portprocessor.getOutputPort(name)
Get input portprocessor.getInputPort(name)
Read argumentsprocessor.getArguments()
Expand variablesprocessor.expandString(template)
Log infoprocessor.logInfo(msg)
Log warningprocessor.logWarning(msg)
Log errorprocessor.logError(msg)

See Also