@@ -354,17 +354,10 @@ The procedure for yielding incremental results is specified by the
354
354
355
355
YieldIncrementalResults(data, errors, incrementalDataRecords):
356
356
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)}.
364
358
- 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)}.
368
361
- For each completed child Pending Incremental Data node of a root node in
369
362
{graph}:
370
363
- Let {incrementalDataRecord} be the Pending Incremental Data for that node;
@@ -405,13 +398,24 @@ YieldIncrementalResults(data, errors, incrementalDataRecords):
405
398
- Let {newPendingResults} be a new set containing the result of
406
399
{GetNonEmptyNewPending(graph, pendingResults)}.
407
400
- 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}.
410
402
- Let {pending} be the result of {GetPendingEntry(newPendingResults)}.
411
403
- Yield the result of {GetIncrementalResult(graph, incremental, completed,
412
404
pending)}.
413
405
- Complete this incremental result stream.
414
406
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
+
415
419
GetNonEmptyNewPending(graph, oldPendingResults):
416
420
417
421
- If not provided, initialize {oldPendingResults} to the empty set.
0 commit comments