# Questions on perspective component message handler

**URL:** <https://forum.inductiveautomation.com/t/questions-on-perspective-component-message-handler/44055>\
**Category:** Ignition\
**Created:** [March 3, 2021, 6:52pm UTC](https://forum.inductiveautomation.com/t/questions-on-perspective-component-message-handler/44055 "2021-03-03T18:52:24Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![wzhigan](https://avatars.discourse-cdn.com/v4/letter/w/e95f7d/32.png) [@wzhigan](https://forum.inductiveautomation.com/u/wzhigan)\
**Post date:** [March 3, 2021, 6:52pm UTC](https://forum.inductiveautomation.com/t/questions-on-perspective-component-message-handler/44055/1 "2021-03-03T18:52:24Z")

</div>

1. notice the onMessageReceived() runs twice in session (but run only once when triggered in designer):  
the test code is logging an info to gateway log: logger.info("query good: " + str(i))  
see twice on each event as below  

2. looks like onMessageReceived() triggers a thread on gateway, how does this thread communicate with session, is it http request and using call back? want to know this because if i run a long script in onMessageReceived(), will the session be frozen?

---

<div class="post-metadata">

**Author:** ![wzhigan](https://avatars.discourse-cdn.com/v4/letter/w/e95f7d/32.png) [@wzhigan](https://forum.inductiveautomation.com/u/wzhigan)\
**Post date:** [March 3, 2021, 10:05pm UTC](https://forum.inductiveautomation.com/t/questions-on-perspective-component-message-handler/44055/2 "2021-03-03T22:05:31Z")

</div>

My bad, the view duplicates on the session… it is resolved.
