Traversal Synchronicity

By default, chainlet operates in synchronous mode: there is a fixed ordering by which elements are traversed. Both chains and bundles are traversed one element at a time.

However, chainlet also allows for asynchronous mode: any elements which do not explicitly depend on each other can be traversed in parallel.

Synchronous Traversal

Synchronous mode follows the order of elements in chains and bundles [1]. Consider the following setup:

a >> b >> [c >> d, e >> f] >> g >> h

This is broken down into four chains, two of which are part of a bundle. Every chain is simply traversed according to its ordering - a before b, c before d and so on.

The bundle implicitly forks the data stream to both c and e. This fork is traversed in definition order, in this case c >> d before e >> f.

Synchronous traversal only guarantees consistency in each stream - but not about the ordering of chainlinks across the forked data stream. That is, the final sequence g >> h is always traversed after its respective source chain c >> d or e >> f. However, the first traversal of g >> h may or may not occur before e >> f, the second element of the bundle.

digraph graphname {
    graph [rankdir=LR, splines=lines, bgcolor="transparent"]
    a -> b
    b -> c -> d -> g [color=red]
    b -> e -> f -> g [color=blue]
    g -> h [color=cyan]
    g -> h [color=magenta]
}

In other words, the traversal always picks black over red, red over blue, red over magenta and blue over cyan. This implies that magenta is traversed before cyan. However, it does not imply an ordering between blue and magenta.

Finally, synchronous traversal always respects the ordering of complete traversals. For every input, the entire chain

[1]In some cases, such as bundles from a set, traversal order may be arbitrary. However, it is still fixed and stable.