Transformer Pipeline Module API Reference
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
id initialiser
pipeline-file pipeline.lua
initialise-func initialise

Object lifetime

Lua 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 Nov 23 2022 17:48:35 for Transformer Pipeline Module API Reference