Jump to content
  • How to - Run Iron Python in a loop (without memory leaks!)


    This Article provides useful Spotfire TIps & Tricks
    Article provided by SDG Group

    You may already be aware that there is a trick to make iron python run repeatedly on a page, which is:

    1. Create a spotfire action button to run the iron python
    2. Wrap this button in a div, so that we can find it in javascript
    3. Create Javascript and use "SetInterval" to click this button repeatedly

    We discovered that the common implementation of the loop trick has a flaw - the javascript "SetInterval" method is fired on every page load. So on multi-tab applications, we end up with many instances of the loop, piling higher and higher until the application becomes unresponsive.

    Attached you will find a dxp that resolves this issue by storing the ID of the created interval, which is cleared out before running a new one.


    We hope you find this page useful. Do you have a challenge we could help with? Get in touch!

    SDG Group on the TIBCO Partner Directory


    Attachments

    You can download attachments from resources.

    python_looper.zip


    User Feedback

    Recommended Comments

    There are no comments to display.


×
×
  • Create New...