Directing several flows in 1 function node

Hi,

Just a question in my project i'm sending several inputs into 1 function node. (or is it discouraged?)
image

It works but i'm wondering how node red handles this? Is it's storing all the flows at the beginning and treats it one at a time or are all the flows treated at the same time in parrallel?

And if it's handles the flows 1 at a time, what's the max storage of the flows before? (guessing the system memory).

Thanks at advance!
Kind regards,
Ward

Your terminology is a bit mixed up.

Whats happening is each time a message object (msg) is emitted from a node (e.g. from your green nodes on the left), they travel down the wires and are operated on by the nodes they flow to/through.

The code in the last function simply does its thing everytime a msg hits it.

That mostly depends on what you are doing in the function nodes. But no, this is a perfectly legitimate setup and use of nodes.

The messages are kinda serial as in they travel down the wires singularly (nodejs is single threaded) and unless you have a HUGE number of msgs travelling down the wires, you are unlikely to be facing any issues. (I have no details on what that HUGE number would be - possibly memory limited)

@Steve-Mcl thanks for the quick reply.

I've got to work on that :sweat_smile: :wink:

But now i know for certain it's never gonna drop a msg if the node is busy.

1 Like

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