# Ignition Keep Alive Code

**URL:** <https://forum.inductiveautomation.com/t/ignition-keep-alive-code/116375>\
**Category:** Ignition\
**Created:** [July 13, 2026, 5:27pm UTC](https://forum.inductiveautomation.com/t/ignition-keep-alive-code/116375 "2026-07-13T17:27:59Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [July 13, 2026, 5:46pm UTC](https://forum.inductiveautomation.com/t/ignition-keep-alive-code/116375/2 "2026-07-13T17:46:44Z")

</div>

> [@Managing multiple asynchronous threads](https://forum.inductiveautomation.com/t/managing-multiple-asynchronous-threads/37185/2):
>
> To manage long-running jython threads through scripting restarts, you need to: Place the thread object in a dictionary that retains its content through script restarts. I used to recommend the dictionary from system.util.getGlobals(), but that is no longer suitable. I created a free [Life Cycle Module](http://forum.inductiveautomation.com/t/system-util-getglobals-not-persisted-across-designer-save/33869/14) that provides such dictionaries going forward. Write the asynchronous function’s loop so that it regularly checks [Thread.interrupted()](https://docs.oracle.com/javase/8/docs/api/java/lang/Thread.html#interrupted--), particularly after any java I/O operations. Clean up …

(But note that my life cycle module's features have been superceded by the integration toolkit.)

> [@Julian\_Islic](#):
>
> I wish that the gateway had a keep alive event handler that would just run a script indefinitely.

Not actually possible--leaks the memory of the jython interpreter of the old version of the code in question (along with everything else referenced by the old interpreter). Under no circumstance should you place jython classes into a JVM persistent dictionary.

---

_[View the full topic](https://forum.inductiveautomation.com/t/ignition-keep-alive-code/116375)._
