# Could be possible doing something like this parallel run

**URL:** <https://discourse.nodered.org/t/could-be-possible-doing-something-like-this-parallel-run/34709>\
**Category:** General\
**Created:** [23 October 2020 12:20 UTC](https://discourse.nodered.org/t/could-be-possible-doing-something-like-this-parallel-run/34709 "2020-10-23T12:20:20Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![crester](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/crester/32/21997_2.png) [@crester](https://discourse.nodered.org/u/crester)\
**Post date:** [23 October 2020 12:20 UTC](https://discourse.nodered.org/t/could-be-possible-doing-something-like-this-parallel-run/34709/1 "2020-10-23T12:20:20Z")

</div>

Hello  
I want to improve the speed of one application similar as this example.  
I need to avoid http requests and continue with some stuff while the flow is doing logoff  
But I observed never goes throug logout function / http request

Is it possible to do something like this?

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/8/5/85335727957d1a1d82b72551476b8439de59c2c2.png)

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [23 October 2020 12:43 UTC](https://discourse.nodered.org/t/could-be-possible-doing-something-like-this-parallel-run/34709/2 "2020-10-23T12:43:08Z")

</div>

It is not clear what you mean. What do you mean 'it never goes through logout function'?

---

<div class="post-metadata">

**Author:** ![hardillb](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hardillb/32/12373_2.png) [@hardillb](https://discourse.nodered.org/u/hardillb)\
**Post date:** [23 October 2020 13:12 UTC](https://discourse.nodered.org/t/could-be-possible-doing-something-like-this-parallel-run/34709/3 "2020-10-23T13:12:37Z")

</div>

Yes, that should work.

But remember that NodeJS ( and so Node-RED ) is single threaded and event loop based and that messages will flow from the http-request node to which ever of the `logout` or `some stuff` function node was connected first. Execution will continue down that leg until the code yields, which is normally when some IO event is started.

This might be when the msg hits the last http-request node at which point control will be given to the other branch of the flow.

---

<div class="post-metadata">

**Author:** ![crester](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/crester/32/21997_2.png) [@crester](https://discourse.nodered.org/u/crester)\
**Post date:** [23 October 2020 16:42 UTC](https://discourse.nodered.org/t/could-be-possible-doing-something-like-this-parallel-run/34709/4 "2020-10-23T16:42:51Z")

</div>

Thank you.  
I understand now the behaviour I have observed.today that sometimes goes to logout.  
Much userful

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [22 December 2020 16:43 UTC](https://discourse.nodered.org/t/could-be-possible-doing-something-like-this-parallel-run/34709/5 "2020-12-22T16:43:04Z")

</div>

Closed on 22 December 2020 16:43 UTC

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
