@bian-womp/spark-graph 0.2.77 → 0.2.79
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GraphRuntime.d.ts","sourceRoot":"","sources":["../../../../src/runtime/GraphRuntime.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EACZ,iBAAiB,EACjB,YAAY,EACZ,YAAY,EACZ,eAAe,EACf,eAAe,EAKhB,MAAM,2BAA2B,CAAC;AAEnC,OAAO,KAAK,EAIV,gBAAgB,EACjB,MAAM,eAAe,CAAC;AAQvB,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAE/C,MAAM,MAAM,oBAAoB,CAAC,CAAC,SAAS,gBAAgB,IAAI,CAC7D,CAAC,EAAE,eAAe,CAAC,CAAC,CAAC,KAClB,IAAI,CAAC;AAUV,MAAM,MAAM,gBAAgB,GAAG,OAAO,GAAG,YAAY,GAAG,OAAO,GAAG,OAAO,CAAC;AAE1E,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,YAAY,CAAC;IACpB,UAAU,EAAE,iBAAiB,CAAC;IAC9B,KAAK,EAAE,YAAY,CAAC;IACpB,KAAK,EAAE,YAAY,CAAC;CACrB;
|
|
1
|
+
{"version":3,"file":"GraphRuntime.d.ts","sourceRoot":"","sources":["../../../../src/runtime/GraphRuntime.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EACZ,iBAAiB,EACjB,YAAY,EACZ,YAAY,EACZ,eAAe,EACf,eAAe,EAKhB,MAAM,2BAA2B,CAAC;AAEnC,OAAO,KAAK,EAIV,gBAAgB,EACjB,MAAM,eAAe,CAAC;AAQvB,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAE/C,MAAM,MAAM,oBAAoB,CAAC,CAAC,SAAS,gBAAgB,IAAI,CAC7D,CAAC,EAAE,eAAe,CAAC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vC,OAAO,CACL,OAAO,EAAE;QACP,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;QACjD,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;KACnD,EACD,IAAI,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,OAAO,CAAA;KAAE,GAC1B,IAAI;IA6CP,MAAM,CAAC,GAAG,EAAE,eAAe,EAAE,QAAQ,EAAE,QAAQ,GAAG,IAAI;IAwPtD,OAAO,CAAC,wBAAwB;YAWlB,uBAAuB;CA6DtC"}
|
package/lib/esm/index.js
CHANGED
|
@@ -485,6 +485,7 @@ class GraphRuntime {
|
|
|
485
485
|
logLevel: desc.logLevel,
|
|
486
486
|
runSeq: 0,
|
|
487
487
|
activeControllers: new Set(),
|
|
488
|
+
controllerRunIds: new Map(),
|
|
488
489
|
queue: [],
|
|
489
490
|
stats: {
|
|
490
491
|
runs: 0,
|
|
@@ -729,6 +730,7 @@ class GraphRuntime {
|
|
|
729
730
|
node.stats.lastStartAt = now;
|
|
730
731
|
node.stats.progress = 0;
|
|
731
732
|
node.activeControllers.add(controller);
|
|
733
|
+
node.controllerRunIds.set(controller, runId);
|
|
732
734
|
const mode = policy.asyncConcurrency ?? "switch";
|
|
733
735
|
if (mode === "switch") {
|
|
734
736
|
for (const c of Array.from(node.activeControllers)) {
|
|
@@ -743,6 +745,10 @@ class GraphRuntime {
|
|
|
743
745
|
const ctx = this.createExecutionContext(nodeId, node, capturedInputs, runId, controller.signal, {
|
|
744
746
|
emitHandler: (handle, value) => {
|
|
745
747
|
const m = policy.asyncConcurrency ?? "switch";
|
|
748
|
+
// Drop emits from runs that were explicitly cancelled due to a
|
|
749
|
+
// snapshot/undo/redo operation, regardless of asyncConcurrency.
|
|
750
|
+
if (node.snapshotCancelledRunIds?.has(runId))
|
|
751
|
+
return;
|
|
746
752
|
if (m !== "merge" && runId !== node.latestRunId)
|
|
747
753
|
return;
|
|
748
754
|
this.propagate(nodeId, handle, value);
|
|
@@ -790,6 +796,7 @@ class GraphRuntime {
|
|
|
790
796
|
if (timeoutId)
|
|
791
797
|
clearTimeout(timeoutId);
|
|
792
798
|
node.activeControllers.delete(controller);
|
|
799
|
+
node.controllerRunIds.delete(controller);
|
|
793
800
|
node.stats.active = Math.max(0, node.activeControllers.size);
|
|
794
801
|
node.stats.lastEndAt = Date.now();
|
|
795
802
|
node.stats.lastDurationMs =
|
|
@@ -1368,7 +1375,14 @@ class GraphRuntime {
|
|
|
1368
1375
|
const node = this.nodes.get(nodeId);
|
|
1369
1376
|
if (!node)
|
|
1370
1377
|
continue;
|
|
1378
|
+
if (!node.snapshotCancelledRunIds) {
|
|
1379
|
+
node.snapshotCancelledRunIds = new Set();
|
|
1380
|
+
}
|
|
1371
1381
|
for (const controller of Array.from(node.activeControllers)) {
|
|
1382
|
+
const rid = node.controllerRunIds.get(controller);
|
|
1383
|
+
if (rid) {
|
|
1384
|
+
node.snapshotCancelledRunIds.add(rid);
|
|
1385
|
+
}
|
|
1372
1386
|
try {
|
|
1373
1387
|
controller.abort("snapshot");
|
|
1374
1388
|
}
|
|
@@ -1377,6 +1391,7 @@ class GraphRuntime {
|
|
|
1377
1391
|
}
|
|
1378
1392
|
}
|
|
1379
1393
|
node.activeControllers.clear();
|
|
1394
|
+
node.controllerRunIds.clear();
|
|
1380
1395
|
node.stats.active = 0;
|
|
1381
1396
|
node.queue = [];
|
|
1382
1397
|
node.runSeq += 1;
|
|
@@ -1485,6 +1500,7 @@ class GraphRuntime {
|
|
|
1485
1500
|
},
|
|
1486
1501
|
runSeq: 0,
|
|
1487
1502
|
activeControllers: new Set(),
|
|
1503
|
+
controllerRunIds: new Map(),
|
|
1488
1504
|
queue: [],
|
|
1489
1505
|
stats: {
|
|
1490
1506
|
runs: 0,
|