One of the rules of events is that an event can travel through each cable at most once. This rule comes into play when your composition has a feedback loop.
As you learned earlier in this section, feedback loops are a useful construct for accumulating changes over time. You just need to regulate the flow of data through the loop. Here are examples of a working (regulated flow) and a non-working (unregulated flow) feedback loop:
In the working feedback loop:
The event enters the Hold Value node’s Update input port and travels through to the output port.
The event enters the Add node’s input port and travels through to the output port.
The event hits the Hold Value node’s Value input port and is blocked by the event wall.
In the non-working feedback loop, there’s no wall to block the event from looping through the Add node over and over. Vuo reports an infinite feedback loop and doesn’t allow the composition to run.
Comparing the two compositions above, you can see that one way to fix an infinite feedback loop is to insert a node with an event wall, such as Hold Value.
Another way to fix an infinite feedback loop is to get rid of the feedback loop. In the composition above, you could replace the feedback loop with a Count node. The Enqueue node and the Blend Image with Feedback node can also take the place of some feedback loops.
Rarely, you might encounter situations where Vuo reports an infinite feedback loop even though you can logically reason that the loop is finite — like in this composition:
The event would only circle the loop 10 times, so it’s not “infinite”. Nevertheless, you’ll need to restructure your composition to avoid the error. When iterating through a fixed number of items, you can use a Build List, Process List, or Spin Off Events node. (Alternatively, you can circumvent the error by inserting a Spin Off Event node in the loop, but be aware that you could create an actual infinite feedback loop that causes your composition to freeze.)