Transformer Pipeline Module API Reference
Configuration: Pipeline Threads Selector

The thread selector configuration allows a user to select the thread an symbol will be processed on. Use thread-selector-file to configure the name of a pipeine file which should contain the function configured in thread-selector-func. The pipeline file should be placed on the pipeline path pipeline-paths.

The function will be called with the symbol name and the configured number of pipeline threads num-threads. The function should return the thread the symbol should be processed on. If -1 or a value greater than num-threads is returned, default thread selection is used. Below is an example thread-selector-func. It assumes a symbol which is of the form "/THREAD/<digits>"

-- Select the thread number based on the number in the subject
-- Assume the subjects to be selected are /THREAD/<thread number>
function select_thread(subject, num_threads)
-- Get the number part of the subject
if ( string.find(subject, "/THREAD/") == nil ) then
log.log(log.INFO, "Not selecting thread for <"..subject.."> num_threads "..num_threads.."\n")
return -1
local thread_num = tonumber(string.gsub(subject, "/THREAD/", ""))
thread_num = tonumber(thread) % num_threads
log.log(log.INFO, "Selecting thread " ..thread_num.." for <"..subject.."> num_threads "..num_threads.."\n")
return (tonumber(thread) % num_threads)


Type: String
Default: None

Pipeline file to execute to select thread


Type: String
Default: None

Pipeline function to execute to select thread

Generated on Wed Nov 23 2022 17:48:35 for Transformer Pipeline Module API Reference