@@ -351,17 +351,10 @@ The procedure for yielding incremental results is specified by the
351
351
352
352
YieldIncrementalResults(data, errors, incrementalDataRecords):
353
353
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)}.
361
355
- 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)}.
365
358
- For each completed child Pending Incremental Data node of a root node in
366
359
{graph}:
367
360
- Let {incrementalDataRecord} be the Pending Incremental Data for that node;
@@ -402,13 +395,24 @@ YieldIncrementalResults(data, errors, incrementalDataRecords):
402
395
- Let {newPendingResults} be a new set containing the result of
403
396
{GetNonEmptyNewPending(graph, pendingResults)}.
404
397
- 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}.
407
399
- Let {pending} be the result of {GetPendingEntry(newPendingResults)}.
408
400
- Yield the result of {GetIncrementalResult(graph, incremental, completed,
409
401
pending)}.
410
402
- Complete this incremental result stream.
411
403
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
+
412
416
GetNonEmptyNewPending(graph, oldPendingResults):
413
417
414
418
- If not provided, initialize {oldPendingResults} to the empty set.
0 commit comments