Modify the behaviour of code for test or production

The ‘iguana’ namespace has two helpful functions for dealing with scripts that can be slow: iguana.isTest() and iguana.setTimeout()

iguana.isTest() will return true if the code is running in the context of the editor. So when iguana.isTest() returns true  you could set a 5 second timeout, for editing/testing. And when it returns false you can specify a longer timeout than the default of 5 minutes for when the channel is in production.

Also if you had a batch interface then within the code you could modify the execution to only process the first 10 messages instead of say 1000 if iguana.isTest() returns true.

This makes the editor much more responsive and will speed up your interface development process.

Leave A Comment?