Transformer Pipeline Module API Reference (JavaScript)  8.0.2.290852-a608fcd3
Pipeline Concepts: Script and object lifetime

Script lifetime

A pipeline script may be loaded multiple times, thus it's not possible to guarantee that the initialise-func of a script will only be called a single time. To this end, it might be best to define a separate pipeline that handles are the initialisation of the system. The sole purpose of this pipeline will be to perform initialisation and such is guaranteed to be instantiated a single time only:

# Initialisation pipeline - initialise() will only be called once
add-pipeline
id initialiser
pipeline-file pipeline.js
initialise-func initialise
no-delay-load
end-pipeline

Object lifetime

JavaScript is a garbage collected language and as such there is no need to explicitly destroy any created objects or tables: they should be cleaned up as soon as your event function returns.

This may lead to the artefact that any global variables that are defined by your script are still extant when your event function is subsequently called. You should not rely on this behaviour since it may be changed in a future version of the pipeline module.


Generated on Wed Jul 31 2024 18:00:29 for Transformer Pipeline Module API Reference (JavaScript)