Object A contains an array of type B. During runtime, A loops through the array and fires a function of B.
That function on B runs and during execution passes some of it’s data to object C via one of C’s functions. The order in which that data reaches C is not consistent. Sometimes instance B1 is the first one to interact with C, sometimes instance B2 is first.
I would expect the execution flow to go: A.foo() → B1.bar() → C.fizz(), wind back to A, B2.bar() → C.fizz()
Instead it looks like A is firing B1 and B2 back to back without waiting. After this, it appears to be non-deterministic which instance of B calls C.fizz() first. Are my assumptions correct?
Basically no. The code structure fires off event as fast as it can and some events can overtake others, even though they started later.
A great example in the Sequence node. It does fire the events in sequence, but doesn’t wait for pin1 to end before firing pin2 etc.
This answers my question. I would have assumed that the sequence node would wait, and I what I’m doing is more or less the same thing as a sequence node. I’ll change the receiver to assume it might receive things out of order.
A good example would be:
A background in traditional programming would lead you to expect that hello would be printed every second, ten times.
In fact there’s just a flood of hellos, followed by the delays, that we never see.
However, you can rely on something like a timeline to run the Completed node after it has fired all the Update commands.
Sometimes you do really need order ( although not much ). I have written ( and it’s pretty common ) a while node with a delay and a for loop that doesn’t run the next line until it gets the ‘next’ signal.
This is pretty easy in macro…