Skip to content

Commit fd3987c

Browse files
committed
be more graphy
1 parent d4934b3 commit fd3987c

File tree

1 file changed

+16
-12
lines changed

1 file changed

+16
-12
lines changed

spec/Section 6 -- Execution.md

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -354,17 +354,10 @@ The procedure for yielding incremental results is specified by the
354354

355355
YieldIncrementalResults(data, errors, incrementalDataRecords):
356356

357-
- Initialize {graph} to an empty directed acyclic graph.
358-
- For each {incrementalDataRecord} of {incrementalDataRecords}:
359-
- Add {incrementalDataRecord} to {graph} as a new Pending Data node directed
360-
from the {pendingResults} that it completes, adding each of {pendingResults}
361-
to {graph} as new nodes, if necessary, each directed from its {parent}, if
362-
defined, recursively adding each {parent} as necessary until
363-
{incrementalDataRecord} is connected to {graph}.
357+
- Let {graph} be the result of {BuildGraph(incrementalDataRecords)}.
364358
- Let {pendingResults} be the result of {GetNonEmptyNewPending(graph)}.
365-
- Prune root nodes from {graph} not in {pendingResults}, repeating as necessary
366-
until all root nodes in {graph} are also in {pendingResults}.
367-
- Yield the result of {GetInitialResult(data, errors, pending)}.
359+
- Update {graph} to the subgraph rooted at nodes in {pendingResults}.
360+
- Yield the result of {GetInitialResult(data, errors, pendingResults)}.
368361
- For each completed child Pending Incremental Data node of a root node in
369362
{graph}:
370363
- Let {incrementalDataRecord} be the Pending Incremental Data for that node;
@@ -405,13 +398,24 @@ YieldIncrementalResults(data, errors, incrementalDataRecords):
405398
- Let {newPendingResults} be a new set containing the result of
406399
{GetNonEmptyNewPending(graph, pendingResults)}.
407400
- Add all nodes in {newPendingResults} to {pendingResults}.
408-
- Prune root nodes from {graph} not in {pendingResults}, repeating as
409-
necessary until all root nodes in {graph} are also in {pendingResults}.
401+
- Update {graph} to the subgraph rooted at nodes in {pendingResults}.
410402
- Let {pending} be the result of {GetPendingEntry(newPendingResults)}.
411403
- Yield the result of {GetIncrementalResult(graph, incremental, completed,
412404
pending)}.
413405
- Complete this incremental result stream.
414406

407+
BuildGraph(incrementalDataRecords):
408+
409+
- Initialize {graph} to an empty directed acyclic graph, where the root nodes
410+
represent the Subsequent Result nodes that have been released as pending.
411+
- For each {incrementalDataRecord} of {incrementalDataRecords}:
412+
- Add {incrementalDataRecord} to {graph} as a new Pending Data node directed
413+
from the {pendingResults} that it completes, adding each of {pendingResults}
414+
to {graph} as new nodes, if necessary, each directed from its {parent}, if
415+
defined, recursively adding each {parent} as necessary until
416+
{incrementalDataRecord} is connected to {graph}.
417+
- Return {graph}.
418+
415419
GetNonEmptyNewPending(graph, oldPendingResults):
416420

417421
- If not provided, initialize {oldPendingResults} to the empty set.

0 commit comments

Comments
 (0)