Skip to content

Commit c7d5ccd

Browse files
committed
be more graphy
1 parent b9a2500 commit c7d5ccd

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
@@ -351,17 +351,10 @@ The procedure for yielding incremental results is specified by the
351351

352352
YieldIncrementalResults(data, errors, incrementalDataRecords):
353353

354-
- Initialize {graph} to an empty directed acyclic graph.
355-
- For each {incrementalDataRecord} of {incrementalDataRecords}:
356-
- Add {incrementalDataRecord} to {graph} as a new Pending Data node directed
357-
from the {pendingResults} that it completes, adding each of {pendingResults}
358-
to {graph} as new nodes, if necessary, each directed from its {parent}, if
359-
defined, recursively adding each {parent} as necessary until
360-
{incrementalDataRecord} is connected to {graph}.
354+
- Let {graph} be the result of {BuildGraph(incrementalDataRecords)}.
361355
- Let {pendingResults} be the result of {GetNonEmptyNewPending(graph)}.
362-
- Prune root nodes from {graph} not in {pendingResults}, repeating as necessary
363-
until all root nodes in {graph} are also in {pendingResults}.
364-
- Yield the result of {GetInitialResult(data, errors, pending)}.
356+
- Update {graph} to the subgraph rooted at nodes in {pendingResults}.
357+
- Yield the result of {GetInitialResult(data, errors, pendingResults)}.
365358
- For each completed child Pending Incremental Data node of a root node in
366359
{graph}:
367360
- Let {incrementalDataRecord} be the Pending Incremental Data for that node;
@@ -402,13 +395,24 @@ YieldIncrementalResults(data, errors, incrementalDataRecords):
402395
- Let {newPendingResults} be a new set containing the result of
403396
{GetNonEmptyNewPending(graph, pendingResults)}.
404397
- Add all nodes in {newPendingResults} to {pendingResults}.
405-
- Prune root nodes from {graph} not in {pendingResults}, repeating as
406-
necessary until all root nodes in {graph} are also in {pendingResults}.
398+
- Update {graph} to the subgraph rooted at nodes in {pendingResults}.
407399
- Let {pending} be the result of {GetPendingEntry(newPendingResults)}.
408400
- Yield the result of {GetIncrementalResult(graph, incremental, completed,
409401
pending)}.
410402
- Complete this incremental result stream.
411403

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

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

0 commit comments

Comments
 (0)