Signal Propagation

This tutorial demonstrates how data propagates through the network of connections, what is the difference between control and data nodes, and how to synchronise diverged paths.

Data

Data connections propagate values at the first opportunity. Simple nodes without control slots will output or accept values as they come. TextValue for example updates output slot as soon as text edit control notifies about accepted input.

Workspace is evaluated constantly at predefined time intervals by running a cycle:

  1. Evaluate all connections - pass values from source to target slot
  2. Evaluate all nodes - accept input and calculate the result
  3. Wait for time interval and start again

So in the example above, the propagation looks like this:

  1. Step 1:
    1. Change value of A in the edit box, the node detects input and puts it into out slot.
  2. Step 2:
    1. Connection AB detects value in source slot, passes it to target slot.
    2. Node B detects value in in slot, puts it into edit box and copies to out slot.
  3. Step 3:
    1. Connection BC detects value in source slot, passes it to target slot.
    2. Node C detects value in in slot, puts it into edit box and copies to out slot.

Control

Control is a special data packet type and treated in a different way from the others. Slots that produce or accept control data packets are coloured blue. Control is required in situations where user input is explicitly required. Normal data will propagate at any opportunity, but control has to be generated explicitly, by, for example, pressing a button.

In this example, HtmlView node expects control to update HTML renderer, so passing HTML text from TextValue does nothing at first. And only when you press the Push button, a control packet gets generated and passed to HtmlView which refreshes the page.

Control packets can bear authentication information as well, for example in most cases you will be required to provide credentials when using HTTP nodes. Those credentials can be generated by com.dmc.std.auth nodes. The value of control packets cannot be inspected in slots.

Synchronisation

In some cases when propagation paths diverge, but then you want to use the results together, it can get a little tricky. This example is quite artificial, but it demostrates the actual problem: the path from Push node to HtmlView is just a single connection, and pressing the button will refresh HtmlView before the text passes through TextFormatControl node, so the previous HTML text will be used.

We can synchronise diverged paths by using a Barrier node. This node will stop incoming packets until both of the inputs arrive, and it will then release both inputs simultaneously. So both control and transformed HTML will reach HtmlView simultaneously.