# Listeners and Threads

**URL:** <https://forum.inductiveautomation.com/t/listeners-and-threads/7794>\
**Category:** Module Development\
**Created:** [January 7, 2014, 1:01pm UTC](https://forum.inductiveautomation.com/t/listeners-and-threads/7794 "2014-01-07T13:01:53Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![alcaan](https://avatars.discourse-cdn.com/v4/letter/a/8edcca/32.png) [@alcaan](https://forum.inductiveautomation.com/u/alcaan)\
**Post date:** [January 7, 2014, 1:01pm UTC](https://forum.inductiveautomation.com/t/listeners-and-threads/7794/1 "2014-01-07T13:01:53Z")

</div>

Hi, I’m using this code to unsubscribe the listeners in a module:

tagManager.unsubscribe(paths, listeners) // where paths and listeners are lists

The problem is tha when I restart the module new threads appear in the consolo/threads. There is a way to remove threads of listeners when this happens?

---

<div class="post-metadata">

**Author:** ![Kyle\_Chase](https://avatars.discourse-cdn.com/v4/letter/k/9de0a6/32.png) [@Kyle\_Chase](https://forum.inductiveautomation.com/u/Kyle_Chase)\
**Post date:** [January 8, 2014, 6:27pm UTC](https://forum.inductiveautomation.com/t/listeners-and-threads/7794/2 "2014-01-08T18:27:36Z")

</div>

Why do you want to remove those threads? These threads are created automatically by the system itself. The threads will exist even if you have no listeners registered? Or maybe I am not understanding?

---

<div class="post-metadata">

**Author:** ![alcaan](https://avatars.discourse-cdn.com/v4/letter/a/8edcca/32.png) [@alcaan](https://forum.inductiveautomation.com/u/alcaan)\
**Post date:** [January 9, 2014, 12:36pm UTC](https://forum.inductiveautomation.com/t/listeners-and-threads/7794/3 "2014-01-09T12:36:27Z")

</div>

The problem is that when I update a module with listeners with new code involving these listeners, I happens that the old code are running at the same time. That is for example that I write a memory tag every 10 seconds and then I have two threads modifying that tag alternatively. I tried to restart Ignition to stop this behavior but didn’t have luck with this either. It is like there is a cache of the module and the old code that it is not in the new module anymore keeps running.
