INIT call
One of the design challenges with Iguana X is how to start components which do not have a component feeding into them.
From 10.1.86 our design solution for this that Iguana X will call the main(Data) function with Data set equal to “INIT”.
This is quite a substantial change from how we did this prior to this. Our components which needed to be boot-strapped had a pattern like this:
if not iguana.isTest() then
-- do some initialization
end
This seemed quite difficult to remember. It’s nicer to be able to have initialization as a specific message and then be able to see it in the logs for a component.
For customers who have been evaluating IguanaX prior to this change it will be necessary to update components to handle this change. This is the new pattern:
function main(Data)
if Data == "INIT" then
-- do some initialization
return
end
end