Skip to content
language.blue
repo.blue ↗Run this example

03 · Embedding

One Counter, Two Hosts

Attach one managed Counter to two independent Host documents. Both Hosts catch up to its existing history. A later increment executes once on the Counter and publishes one child revision to each active parent edge.

Executable Playground example3 participants3 documentsProcess Embedded

Document graph

Reuse the child; do not copy its state.

The Counter remains an independently managed Root with its own operations and revision history. Each Host stores an explicit embedding relationship and consumes the child revision stream through its own occurrence path.

One child execution, two parent applications.

Fan-out does not mean the child operation ran twice. Coordination processes the Counter once, then applies its new revision once along each active edge.

First Host ─────┐
                 │ Process Embedded
                 ▼
           Shared Counter
                 ▲
                 │ Process Embedded
Second Host ────┘

one child session
two parent edges
one later revision → two applications

Run it

Watch the graph form.

The Guide separates creation, attachment, catch-up, and live propagation so each boundary is visible on the canvas.

01
Start the Counter and both Hosts.Each cube represents a separately managed document Root.
02
Give the Counter existing history.Commit a child revision before either parent depends on it.
03
Attach the first Host, then the second.Each parent admits the exact child identity and catches up through eligible history.
04
Increment the shared Counter.See one child epoch and one resulting application on each active Host edge.

What this teaches

Identity, ownership, and occurrence are different.

The child owns its state. Each parent owns its reaction to the child. The edge records where that exact child occurs inside a particular Host.

ChildOne authoritative managed Counter and revision stream.
ParentsTwo independent Roots with separate histories.
Catch-upEach new edge consumes eligible retained child revisions.
Fan-outA live child revision is applied once per active edge.
Next: attach a child only after its story is complete.

The NBA example makes historical catch-up visible across a five-revision state machine.