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)