Skip to content

Commit 8dad2e8

Browse files
committed
finish addressing review comments
1 parent 6862323 commit 8dad2e8

File tree

1 file changed

+34
-10
lines changed

1 file changed

+34
-10
lines changed

spec/Section 6 -- Execution.md

Lines changed: 34 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -381,16 +381,18 @@ to that effect within the initial result, while the `pending` entry for
381381

382382
Delivery group nodes may have three different types of child nodes:
383383

384-
1. Other delivery group nodes, i.e. the node representing `SlowFragment` should
384+
1. Child Delivery Group nodes, i.e. the node representing `SlowFragment` should
385385
have a child node representing `SlowestFragment`.
386-
2. Pending incremental data nodes, i.e. the node for `SlowFragment` should
386+
2. Pending Incremental Data nodes, i.e. the node for `SlowFragment` should
387387
initially have a node for `slowField`.
388-
3. Completed incremental data nodes, i.e. when `slowField` is completed, the
388+
3. Completed Incremental Data nodes, i.e. when `slowField` is completed, the
389389
pending incremental data node for `slowField` should be replaced with a node
390390
representing the completed data.
391391

392392
The {YieldIncrementalResults()} algorithm is responsible for updating the graph
393-
as it yields the incremental results.
393+
as it yields the incremental results. When a delivery group contains only
394+
completed incremental data nodes, the group is removed from the graph as it is
395+
delivered.
394396

395397
YieldIncrementalResults(data, errors, incrementalDataRecords):
396398

@@ -416,7 +418,7 @@ YieldIncrementalResults(data, errors, incrementalDataRecords):
416418
- Let {resultIncrementalDataRecords} be {incrementalDataRecords} on {result}.
417419
- Update {graph} to {GraphFromRecords(resultIncrementalDataRecords, graph)}.
418420
- Let {completedDeferredFragments} be the set of root nodes in {graph} without
419-
any child Pending Data nodes.
421+
any child Pending Incremental Data nodes.
420422
- Let {completedIncrementalDataNodes} be the set of completed Incremental Data
421423
nodes that are children of {completedDeferredFragments}.
422424
- If {completedIncrementalDataNodes} is empty, continue to the next completed
@@ -441,17 +443,39 @@ YieldIncrementalResults(data, errors, incrementalDataRecords):
441443
pending)}.
442444
- Complete this incremental result stream.
443445

446+
New Incremental Data Records are added to the {graph} by the
447+
{GraphFromRecords()} algorithm as Pending Incremental Data nodes directed from
448+
the Deferred Fragments they incrementally complete.
449+
444450
GraphFromRecords(incrementalDataRecords, graph):
445451

446452
- If {graph} is not provided, initialize to an empty graph.
447453
- Let {newGraph} be a new directed acyclic graph containing all of the nodes and
448454
edges in {graph}.
449455
- For each {incrementalDataRecord} of {incrementalDataRecords}:
450-
- Add {incrementalDataRecord} to {newGraph} as a new Pending Data node
451-
directed from the {pendingResults} that it completes, adding each of
452-
{pendingResults} to {newGraph} as a new node directed from its {parent},
453-
recursively adding each {parent} until {incrementalDataRecord} is connected
454-
to {newGraph}, or the {parent} is not defined.
456+
- Let {deferredFragments} be the Deferred Fragments incrementally completed by
457+
{incrementalDataRecord}.
458+
- For each {deferredFragment} of {deferredFragments}:
459+
- Reset {newGraph} to the result of
460+
{GraphWithDeferredFragmentRecord(deferredFragment, newGraph)}.
461+
- Add {incrementalDataRecord} to {newGraph} as a new Pending Incremental Data
462+
node directed from the {deferredFragments} that it completes.
463+
- Return {newGraph}.
464+
465+
The {GraphWithDeferredFragmentRecord()} algorithm returns a new graph containing
466+
the provided Deferred Fragment Record, recursively adding its parent Deferred
467+
Fragment nodes.
468+
469+
GraphWithDeferredFragmentRecord(deferredFragment, graph):
470+
471+
- If {graph} contains a Deferred Fragment node representing {deferredFragment},
472+
return {graph}.
473+
- Let {parent} be the parent Deferred Fragment of {deferredFragment}.
474+
- If {parent} is defined, let {newGraph} be the result of
475+
{GraphWithDeferredFragmentRecord(parent, graph)}; otherwise, let {newGraph} be
476+
a new directed acyclic graph containing all of the nodes and edges in {graph}.
477+
- Add {deferredFragment} to {newGraph} as a new Deferred Fragment node directed
478+
from {parent}, if defined.
455479
- Return {newGraph}.
456480

457481
The {GetNewRootNodes()} algorithm is responsible for determining the new root

0 commit comments

Comments
 (0)