@dxos/echo-pipeline 0.1.31 → 0.1.32-next.77d513e
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.
- package/dist/lib/browser/{chunk-QMDRF3NL.mjs → chunk-EM5HSJ7J.mjs} +121 -86
- package/dist/lib/browser/chunk-EM5HSJ7J.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +3 -5
- package/dist/lib/browser/index.mjs.map +1 -1
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/testing/index.mjs +12 -4
- package/dist/lib/browser/testing/index.mjs.map +3 -3
- package/dist/lib/node/index.cjs +121 -87
- package/dist/lib/node/index.cjs.map +4 -4
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/testing/index.cjs +126 -76
- package/dist/lib/node/testing/index.cjs.map +4 -4
- package/dist/types/src/metadata/metadata-store.d.ts +1 -2
- package/dist/types/src/metadata/metadata-store.d.ts.map +1 -1
- package/dist/types/src/pipeline/pipeline.d.ts +10 -1
- package/dist/types/src/pipeline/pipeline.d.ts.map +1 -1
- package/dist/types/src/space/{data-pipeline-controller.d.ts → data-pipeline.d.ts} +10 -18
- package/dist/types/src/space/data-pipeline.d.ts.map +1 -0
- package/dist/types/src/space/index.d.ts +1 -1
- package/dist/types/src/space/index.d.ts.map +1 -1
- package/dist/types/src/space/space.d.ts +6 -4
- package/dist/types/src/space/space.d.ts.map +1 -1
- package/dist/types/src/testing/test-agent-builder.d.ts +2 -2
- package/dist/types/src/testing/test-agent-builder.d.ts.map +1 -1
- package/dist/types/src/testing/util.d.ts +2 -2
- package/dist/types/src/testing/util.d.ts.map +1 -1
- package/package.json +29 -29
- package/src/metadata/metadata-store.ts +1 -2
- package/src/pipeline/pipeline.ts +18 -3
- package/src/space/{data-pipeline-controller.ts → data-pipeline.ts} +61 -38
- package/src/space/index.ts +1 -1
- package/src/space/space.ts +22 -23
- package/src/testing/test-agent-builder.ts +10 -4
- package/src/testing/util.ts +2 -5
- package/dist/lib/browser/chunk-QMDRF3NL.mjs.map +0 -7
- package/dist/types/src/space/data-pipeline-controller.d.ts.map +0 -1
|
@@ -55,7 +55,7 @@ var MetadataStore = class {
|
|
|
55
55
|
size: dataSize
|
|
56
56
|
}, {
|
|
57
57
|
file: "metadata-store.ts",
|
|
58
|
-
line:
|
|
58
|
+
line: 67,
|
|
59
59
|
scope: this,
|
|
60
60
|
callSite: (f, a) => f(...a)
|
|
61
61
|
});
|
|
@@ -71,7 +71,7 @@ var MetadataStore = class {
|
|
|
71
71
|
err
|
|
72
72
|
}, {
|
|
73
73
|
file: "metadata-store.ts",
|
|
74
|
-
line:
|
|
74
|
+
line: 79,
|
|
75
75
|
scope: this,
|
|
76
76
|
callSite: (f, a) => f(...a)
|
|
77
77
|
});
|
|
@@ -96,7 +96,7 @@ var MetadataStore = class {
|
|
|
96
96
|
size: encoded.length
|
|
97
97
|
}, {
|
|
98
98
|
file: "metadata-store.ts",
|
|
99
|
-
line:
|
|
99
|
+
line: 102,
|
|
100
100
|
scope: this,
|
|
101
101
|
callSite: (f, a) => f(...a)
|
|
102
102
|
});
|
|
@@ -111,7 +111,7 @@ var MetadataStore = class {
|
|
|
111
111
|
async clear() {
|
|
112
112
|
log("clearing all metadata", {}, {
|
|
113
113
|
file: "metadata-store.ts",
|
|
114
|
-
line:
|
|
114
|
+
line: 115,
|
|
115
115
|
scope: this,
|
|
116
116
|
callSite: (f, a) => f(...a)
|
|
117
117
|
});
|
|
@@ -257,6 +257,7 @@ __decorate2([
|
|
|
257
257
|
// packages/core/echo/echo-pipeline/src/pipeline/pipeline.ts
|
|
258
258
|
import assert4 from "@dxos/node-std/assert";
|
|
259
259
|
import { sleep, Trigger } from "@dxos/async";
|
|
260
|
+
import { Context, rejectOnDispose } from "@dxos/context";
|
|
260
261
|
import { FeedSetIterator } from "@dxos/feed-store";
|
|
261
262
|
import { PublicKey } from "@dxos/keys";
|
|
262
263
|
import { log as log4 } from "@dxos/log";
|
|
@@ -301,7 +302,7 @@ var PipelineState = class {
|
|
|
301
302
|
return this._timeframeClock.timeframe;
|
|
302
303
|
}
|
|
303
304
|
get targetTimeframe() {
|
|
304
|
-
return this._targetTimeframe ?
|
|
305
|
+
return this._targetTimeframe ? this._targetTimeframe : new Timeframe2();
|
|
305
306
|
}
|
|
306
307
|
async waitUntilTimeframe(target) {
|
|
307
308
|
await this._timeframeClock.waitUntilReached(target);
|
|
@@ -316,7 +317,7 @@ var PipelineState = class {
|
|
|
316
317
|
*
|
|
317
318
|
* @param timeout Timeout in milliseconds to specify the maximum wait time.
|
|
318
319
|
*/
|
|
319
|
-
async waitUntilReachedTargetTimeframe({ timeout } = {}) {
|
|
320
|
+
async waitUntilReachedTargetTimeframe({ ctx = new Context(), timeout, breakOnStall = true } = {}) {
|
|
320
321
|
var _a;
|
|
321
322
|
log4("waitUntilReachedTargetTimeframe", {
|
|
322
323
|
timeout,
|
|
@@ -324,7 +325,7 @@ var PipelineState = class {
|
|
|
324
325
|
target: this.targetTimeframe
|
|
325
326
|
}, {
|
|
326
327
|
file: "pipeline.ts",
|
|
327
|
-
line:
|
|
328
|
+
line: 96,
|
|
328
329
|
scope: this,
|
|
329
330
|
callSite: (f, a) => f(...a)
|
|
330
331
|
});
|
|
@@ -332,11 +333,14 @@ var PipelineState = class {
|
|
|
332
333
|
this._timeframeClock.update.waitForCondition(() => {
|
|
333
334
|
return Timeframe2.dependencies(this.targetTimeframe, this.timeframe).isEmpty();
|
|
334
335
|
}),
|
|
335
|
-
|
|
336
|
+
...breakOnStall ? [
|
|
337
|
+
this._iterator.stalled.discardParameter().waitForCount(1)
|
|
338
|
+
] : []
|
|
336
339
|
]);
|
|
337
340
|
let done = false;
|
|
338
341
|
if (timeout) {
|
|
339
342
|
return Promise.race([
|
|
343
|
+
rejectOnDispose(ctx),
|
|
340
344
|
this._reachedTargetPromise.then(() => {
|
|
341
345
|
done = true;
|
|
342
346
|
}),
|
|
@@ -351,7 +355,7 @@ var PipelineState = class {
|
|
|
351
355
|
dependencies: Timeframe2.dependencies(this.targetTimeframe, this.timeframe)
|
|
352
356
|
}, {
|
|
353
357
|
file: "pipeline.ts",
|
|
354
|
-
line:
|
|
358
|
+
line: 122,
|
|
355
359
|
scope: this,
|
|
356
360
|
callSite: (f, a) => f(...a)
|
|
357
361
|
});
|
|
@@ -377,7 +381,7 @@ var Pipeline = class {
|
|
|
377
381
|
this._feedSetIterator.stalled.on((iterator) => {
|
|
378
382
|
log4.warn(`Stalled after ${iterator.options.stallTimeout}ms with ${iterator.size} feeds.`, {}, {
|
|
379
383
|
file: "pipeline.ts",
|
|
380
|
-
line:
|
|
384
|
+
line: 198,
|
|
381
385
|
scope: this,
|
|
382
386
|
callSite: (f, a) => f(...a)
|
|
383
387
|
});
|
|
@@ -407,14 +411,14 @@ var Pipeline = class {
|
|
|
407
411
|
async start() {
|
|
408
412
|
log4("starting...", {}, {
|
|
409
413
|
file: "pipeline.ts",
|
|
410
|
-
line:
|
|
414
|
+
line: 233,
|
|
411
415
|
scope: this,
|
|
412
416
|
callSite: (f, a) => f(...a)
|
|
413
417
|
});
|
|
414
418
|
await this._feedSetIterator.open();
|
|
415
419
|
log4("started", {}, {
|
|
416
420
|
file: "pipeline.ts",
|
|
417
|
-
line:
|
|
421
|
+
line: 235,
|
|
418
422
|
scope: this,
|
|
419
423
|
callSite: (f, a) => f(...a)
|
|
420
424
|
});
|
|
@@ -422,7 +426,7 @@ var Pipeline = class {
|
|
|
422
426
|
async stop() {
|
|
423
427
|
log4("stopping...", {}, {
|
|
424
428
|
file: "pipeline.ts",
|
|
425
|
-
line:
|
|
429
|
+
line: 239,
|
|
426
430
|
scope: this,
|
|
427
431
|
callSite: (f, a) => f(...a)
|
|
428
432
|
});
|
|
@@ -430,7 +434,7 @@ var Pipeline = class {
|
|
|
430
434
|
await this._processingTrigger.wait();
|
|
431
435
|
log4("stopped", {}, {
|
|
432
436
|
file: "pipeline.ts",
|
|
433
|
-
line:
|
|
437
|
+
line: 242,
|
|
434
438
|
scope: this,
|
|
435
439
|
callSite: (f, a) => f(...a)
|
|
436
440
|
});
|
|
@@ -455,7 +459,7 @@ var Pipeline = class {
|
|
|
455
459
|
// packages/core/echo/echo-pipeline/src/space/auth.ts
|
|
456
460
|
import assert5 from "@dxos/node-std/assert";
|
|
457
461
|
import { runInContext, scheduleTask } from "@dxos/async";
|
|
458
|
-
import { Context } from "@dxos/context";
|
|
462
|
+
import { Context as Context2 } from "@dxos/context";
|
|
459
463
|
import { randomBytes } from "@dxos/crypto";
|
|
460
464
|
import { log as log5 } from "@dxos/log";
|
|
461
465
|
import { schema as schema3 } from "@dxos/protocols";
|
|
@@ -473,7 +477,7 @@ var AuthExtension = class extends RpcExtension {
|
|
|
473
477
|
// Long timeout because auth can wait for sync in certain cases.
|
|
474
478
|
});
|
|
475
479
|
this._authParams = _authParams;
|
|
476
|
-
this._ctx = new
|
|
480
|
+
this._ctx = new Context2({
|
|
477
481
|
onError: (err) => {
|
|
478
482
|
log5.catch(err, {}, {
|
|
479
483
|
file: "auth.ts",
|
|
@@ -702,7 +706,7 @@ var Space = class Space2 {
|
|
|
702
706
|
credential
|
|
703
707
|
}, {
|
|
704
708
|
file: "space.ts",
|
|
705
|
-
line:
|
|
709
|
+
line: 79,
|
|
706
710
|
scope: this,
|
|
707
711
|
callSite: (f, a) => f(...a)
|
|
708
712
|
});
|
|
@@ -765,7 +769,7 @@ var Space = class Space2 {
|
|
|
765
769
|
async open() {
|
|
766
770
|
log7("opening...", {}, {
|
|
767
771
|
file: "space.ts",
|
|
768
|
-
line:
|
|
772
|
+
line: 149,
|
|
769
773
|
scope: this,
|
|
770
774
|
callSite: (f, a) => f(...a)
|
|
771
775
|
});
|
|
@@ -777,18 +781,17 @@ var Space = class Space2 {
|
|
|
777
781
|
this._isOpen = true;
|
|
778
782
|
log7("opened", {}, {
|
|
779
783
|
file: "space.ts",
|
|
780
|
-
line:
|
|
784
|
+
line: 159,
|
|
781
785
|
scope: this,
|
|
782
786
|
callSite: (f, a) => f(...a)
|
|
783
787
|
});
|
|
784
788
|
}
|
|
785
789
|
async close() {
|
|
786
|
-
var _a;
|
|
787
790
|
log7("closing...", {
|
|
788
791
|
key: this._key
|
|
789
792
|
}, {
|
|
790
793
|
file: "space.ts",
|
|
791
|
-
line:
|
|
794
|
+
line: 164,
|
|
792
795
|
scope: this,
|
|
793
796
|
callSite: (f, a) => f(...a)
|
|
794
797
|
});
|
|
@@ -796,37 +799,30 @@ var Space = class Space2 {
|
|
|
796
799
|
return;
|
|
797
800
|
}
|
|
798
801
|
await this.protocol.stop();
|
|
799
|
-
await ((_a = this._dataPipelineController) == null ? void 0 : _a.close());
|
|
800
802
|
await this._controlPipeline.stop();
|
|
801
803
|
this._isOpen = false;
|
|
802
804
|
log7("closed", {}, {
|
|
803
805
|
file: "space.ts",
|
|
804
|
-
line:
|
|
806
|
+
line: 174,
|
|
805
807
|
scope: this,
|
|
806
808
|
callSite: (f, a) => f(...a)
|
|
807
809
|
});
|
|
808
810
|
}
|
|
809
|
-
|
|
811
|
+
// TODO(dmaretskyi): Make reusable.
|
|
812
|
+
async createDataPipeline({ start }) {
|
|
810
813
|
assert6(this._isOpen, "Space must be open to initialize data pipeline.");
|
|
811
|
-
assert6(!this._dataPipelineController, "Data pipeline already initialized.");
|
|
812
814
|
assert6(!this._dataPipeline, "Data pipeline already initialized.");
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
for (const feed of this._controlPipeline.spaceState.feeds.values()) {
|
|
822
|
-
if (feed.assertion.designation === AdmittedFeed2.Designation.DATA) {
|
|
823
|
-
await this._dataPipeline.addFeed(await this._feedProvider(feed.key));
|
|
824
|
-
}
|
|
825
|
-
}
|
|
826
|
-
await this._dataPipeline.start();
|
|
827
|
-
return this._dataPipeline;
|
|
815
|
+
const pipeline = new Pipeline(start);
|
|
816
|
+
if (this._dataFeed) {
|
|
817
|
+
pipeline.setWriteFeed(this._dataFeed);
|
|
818
|
+
}
|
|
819
|
+
this._dataPipeline = pipeline;
|
|
820
|
+
for (const feed of this._controlPipeline.spaceState.feeds.values()) {
|
|
821
|
+
if (feed.assertion.designation === AdmittedFeed2.Designation.DATA) {
|
|
822
|
+
await pipeline.addFeed(await this._feedProvider(feed.key));
|
|
828
823
|
}
|
|
829
|
-
}
|
|
824
|
+
}
|
|
825
|
+
return pipeline;
|
|
830
826
|
}
|
|
831
827
|
};
|
|
832
828
|
__decorate3([
|
|
@@ -1430,10 +1426,10 @@ var DataServiceImpl = class {
|
|
|
1430
1426
|
}
|
|
1431
1427
|
};
|
|
1432
1428
|
|
|
1433
|
-
// packages/core/echo/echo-pipeline/src/space/data-pipeline
|
|
1429
|
+
// packages/core/echo/echo-pipeline/src/space/data-pipeline.ts
|
|
1434
1430
|
import assert9 from "@dxos/node-std/assert";
|
|
1435
|
-
import { Event as Event3, scheduleTask as scheduleTask2, trackLeaks as trackLeaks4 } from "@dxos/async";
|
|
1436
|
-
import { Context as
|
|
1431
|
+
import { Event as Event3, scheduleTask as scheduleTask2, synchronized as synchronized4, trackLeaks as trackLeaks4 } from "@dxos/async";
|
|
1432
|
+
import { Context as Context3 } from "@dxos/context";
|
|
1437
1433
|
import { failUndefined as failUndefined3 } from "@dxos/debug";
|
|
1438
1434
|
import { ItemManager } from "@dxos/echo-db";
|
|
1439
1435
|
import { log as log12 } from "@dxos/log";
|
|
@@ -1448,22 +1444,21 @@ var __decorate7 = function(decorators, target, key, desc) {
|
|
|
1448
1444
|
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
1449
1445
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
1450
1446
|
};
|
|
1451
|
-
var NoopDataPipelineController = class {
|
|
1452
|
-
async open(context) {
|
|
1453
|
-
}
|
|
1454
|
-
async close() {
|
|
1455
|
-
}
|
|
1456
|
-
};
|
|
1457
1447
|
var MESSAGES_PER_SNAPSHOT = 10;
|
|
1458
1448
|
var AUTOMATIC_SNAPSHOT_DEBOUNCE_INTERVAL = 5e3;
|
|
1459
1449
|
var TIMEFRAME_SAVE_DEBOUNCE_INTERVAL = 500;
|
|
1460
|
-
var
|
|
1450
|
+
var DISABLE_SNAPSHOT_CACHE = false;
|
|
1451
|
+
var DataPipeline = class DataPipeline2 {
|
|
1461
1452
|
constructor(_params) {
|
|
1462
1453
|
this._params = _params;
|
|
1463
|
-
this._ctx = new
|
|
1454
|
+
this._ctx = new Context3();
|
|
1464
1455
|
this._lastAutomaticSnapshotTimeframe = new Timeframe3();
|
|
1456
|
+
this._isOpen = false;
|
|
1465
1457
|
this.onTimeframeReached = new Event3();
|
|
1466
1458
|
}
|
|
1459
|
+
get isOpen() {
|
|
1460
|
+
return this._isOpen;
|
|
1461
|
+
}
|
|
1467
1462
|
get pipelineState() {
|
|
1468
1463
|
var _a;
|
|
1469
1464
|
return (_a = this._pipeline) == null ? void 0 : _a.state;
|
|
@@ -1476,14 +1471,25 @@ var DataPipelineControllerImpl = class DataPipelineControllerImpl2 {
|
|
|
1476
1471
|
var _a;
|
|
1477
1472
|
return snapshotTimeframeToStartingTimeframe((_a = this.snapshotTimeframe) != null ? _a : new Timeframe3());
|
|
1478
1473
|
}
|
|
1474
|
+
setTargetTimeframe(timeframe) {
|
|
1475
|
+
var _a;
|
|
1476
|
+
this._targetTimeframe = timeframe;
|
|
1477
|
+
(_a = this._pipeline) == null ? void 0 : _a.state.setTargetTimeframe(timeframe);
|
|
1478
|
+
}
|
|
1479
1479
|
async open(spaceContext) {
|
|
1480
1480
|
var _a, _b, _c, _d;
|
|
1481
|
+
if (this._isOpen) {
|
|
1482
|
+
return;
|
|
1483
|
+
}
|
|
1481
1484
|
this._spaceContext = spaceContext;
|
|
1482
1485
|
if (this._params.snapshotId) {
|
|
1483
1486
|
this._snapshot = await this._params.snapshotManager.load(this._params.snapshotId);
|
|
1484
1487
|
this._lastAutomaticSnapshotTimeframe = (_b = (_a = this._snapshot) == null ? void 0 : _a.timeframe) != null ? _b : new Timeframe3();
|
|
1485
1488
|
}
|
|
1486
1489
|
this._pipeline = await this._spaceContext.openPipeline(this.getStartTimeframe());
|
|
1490
|
+
if (this._targetTimeframe) {
|
|
1491
|
+
this._pipeline.state.setTargetTimeframe(this._targetTimeframe);
|
|
1492
|
+
}
|
|
1487
1493
|
const feedWriter = createMappedFeedWriter((data) => ({
|
|
1488
1494
|
data
|
|
1489
1495
|
}), (_c = this._pipeline.writer) != null ? _c : failUndefined3());
|
|
@@ -1494,30 +1500,33 @@ var DataPipelineControllerImpl = class DataPipelineControllerImpl2 {
|
|
|
1494
1500
|
await this._consumePipeline();
|
|
1495
1501
|
});
|
|
1496
1502
|
this._createPeriodicSnapshots();
|
|
1503
|
+
this._isOpen = true;
|
|
1497
1504
|
}
|
|
1498
1505
|
_createPeriodicSnapshots() {
|
|
1499
1506
|
this.onTimeframeReached.debounce(TIMEFRAME_SAVE_DEBOUNCE_INTERVAL).on(this._ctx, async () => {
|
|
1500
1507
|
await this._saveLatestTimeframe();
|
|
1501
1508
|
});
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1509
|
+
if (!DISABLE_SNAPSHOT_CACHE) {
|
|
1510
|
+
this.onTimeframeReached.debounce(AUTOMATIC_SNAPSHOT_DEBOUNCE_INTERVAL).on(this._ctx, async () => {
|
|
1511
|
+
var _a, _b;
|
|
1512
|
+
const latestTimeframe = (_a = this._pipeline) == null ? void 0 : _a.state.timeframe;
|
|
1513
|
+
if (!latestTimeframe) {
|
|
1514
|
+
return;
|
|
1515
|
+
}
|
|
1516
|
+
if (latestTimeframe.totalMessages() - this._lastAutomaticSnapshotTimeframe.totalMessages() > MESSAGES_PER_SNAPSHOT) {
|
|
1517
|
+
const snapshot = await this._saveSnapshot();
|
|
1518
|
+
this._lastAutomaticSnapshotTimeframe = (_b = snapshot.timeframe) != null ? _b : failUndefined3();
|
|
1519
|
+
log12("save", {
|
|
1520
|
+
snapshot
|
|
1521
|
+
}, {
|
|
1522
|
+
file: "data-pipeline.ts",
|
|
1523
|
+
line: 161,
|
|
1524
|
+
scope: this,
|
|
1525
|
+
callSite: (f, a) => f(...a)
|
|
1526
|
+
});
|
|
1527
|
+
}
|
|
1528
|
+
});
|
|
1529
|
+
}
|
|
1521
1530
|
}
|
|
1522
1531
|
async _saveSnapshot() {
|
|
1523
1532
|
const snapshot = await this.createSnapshot();
|
|
@@ -1526,21 +1535,41 @@ var DataPipelineControllerImpl = class DataPipelineControllerImpl2 {
|
|
|
1526
1535
|
return snapshot;
|
|
1527
1536
|
}
|
|
1528
1537
|
async _saveLatestTimeframe() {
|
|
1529
|
-
var _a;
|
|
1538
|
+
var _a, _b;
|
|
1530
1539
|
const latestTimeframe = (_a = this._pipeline) == null ? void 0 : _a.state.timeframe;
|
|
1540
|
+
log12("save latest timeframe", {
|
|
1541
|
+
latestTimeframe,
|
|
1542
|
+
spaceKey: this._params.spaceKey
|
|
1543
|
+
}, {
|
|
1544
|
+
file: "data-pipeline.ts",
|
|
1545
|
+
line: 176,
|
|
1546
|
+
scope: this,
|
|
1547
|
+
callSite: (f, a) => f(...a)
|
|
1548
|
+
});
|
|
1531
1549
|
if (latestTimeframe) {
|
|
1532
|
-
|
|
1550
|
+
const newTimeframe = Timeframe3.merge((_b = this._targetTimeframe) != null ? _b : new Timeframe3(), latestTimeframe);
|
|
1551
|
+
await this._params.metadataStore.setSpaceLatestTimeframe(this._params.spaceKey, newTimeframe);
|
|
1533
1552
|
}
|
|
1534
1553
|
}
|
|
1535
1554
|
async close() {
|
|
1536
1555
|
var _a, _b, _c;
|
|
1556
|
+
if (!this._isOpen) {
|
|
1557
|
+
return;
|
|
1558
|
+
}
|
|
1559
|
+
log12("close", {}, {
|
|
1560
|
+
file: "data-pipeline.ts",
|
|
1561
|
+
line: 188,
|
|
1562
|
+
scope: this,
|
|
1563
|
+
callSite: (f, a) => f(...a)
|
|
1564
|
+
});
|
|
1565
|
+
this._isOpen = false;
|
|
1537
1566
|
try {
|
|
1538
1567
|
await this._saveLatestTimeframe();
|
|
1539
1568
|
await this._saveSnapshot();
|
|
1540
1569
|
} catch (err) {
|
|
1541
1570
|
log12.catch(err, {}, {
|
|
1542
|
-
file: "data-pipeline
|
|
1543
|
-
line:
|
|
1571
|
+
file: "data-pipeline.ts",
|
|
1572
|
+
line: 195,
|
|
1544
1573
|
scope: this,
|
|
1545
1574
|
callSite: (f, a) => f(...a)
|
|
1546
1575
|
});
|
|
@@ -1553,6 +1582,7 @@ var DataPipelineControllerImpl = class DataPipelineControllerImpl2 {
|
|
|
1553
1582
|
}
|
|
1554
1583
|
createSnapshot() {
|
|
1555
1584
|
var _a, _b;
|
|
1585
|
+
assert9(this.databaseBackend, "Database backend is not initialized.");
|
|
1556
1586
|
return {
|
|
1557
1587
|
spaceKey: this._params.spaceKey.asUint8Array(),
|
|
1558
1588
|
timeframe: (_b = (_a = this._pipeline) == null ? void 0 : _a.state.timeframe) != null ? _b : new Timeframe3(),
|
|
@@ -1566,8 +1596,8 @@ var DataPipelineControllerImpl = class DataPipelineControllerImpl2 {
|
|
|
1566
1596
|
log12("processing message", {
|
|
1567
1597
|
msg
|
|
1568
1598
|
}, {
|
|
1569
|
-
file: "data-pipeline
|
|
1570
|
-
line:
|
|
1599
|
+
file: "data-pipeline.ts",
|
|
1600
|
+
line: 217,
|
|
1571
1601
|
scope: this,
|
|
1572
1602
|
callSite: (f, a) => f(...a)
|
|
1573
1603
|
});
|
|
@@ -1578,8 +1608,8 @@ var DataPipelineControllerImpl = class DataPipelineControllerImpl2 {
|
|
|
1578
1608
|
log12.error("Could not find feed.", {
|
|
1579
1609
|
feedKey
|
|
1580
1610
|
}, {
|
|
1581
|
-
file: "data-pipeline
|
|
1582
|
-
line:
|
|
1611
|
+
file: "data-pipeline.ts",
|
|
1612
|
+
line: 223,
|
|
1583
1613
|
scope: this,
|
|
1584
1614
|
callSite: (f, a) => f(...a)
|
|
1585
1615
|
});
|
|
@@ -1598,8 +1628,8 @@ var DataPipelineControllerImpl = class DataPipelineControllerImpl2 {
|
|
|
1598
1628
|
}
|
|
1599
1629
|
} catch (err) {
|
|
1600
1630
|
log12.catch(err, {}, {
|
|
1601
|
-
file: "data-pipeline
|
|
1602
|
-
line:
|
|
1631
|
+
file: "data-pipeline.ts",
|
|
1632
|
+
line: 239,
|
|
1603
1633
|
scope: this,
|
|
1604
1634
|
callSite: (f, a) => f(...a)
|
|
1605
1635
|
});
|
|
@@ -1611,9 +1641,15 @@ var DataPipelineControllerImpl = class DataPipelineControllerImpl2 {
|
|
|
1611
1641
|
await this._pipeline.state.waitUntilTimeframe(timeframe);
|
|
1612
1642
|
}
|
|
1613
1643
|
};
|
|
1614
|
-
|
|
1644
|
+
__decorate7([
|
|
1645
|
+
synchronized4
|
|
1646
|
+
], DataPipeline.prototype, "open", null);
|
|
1647
|
+
__decorate7([
|
|
1648
|
+
synchronized4
|
|
1649
|
+
], DataPipeline.prototype, "close", null);
|
|
1650
|
+
DataPipeline = __decorate7([
|
|
1615
1651
|
trackLeaks4("open", "close")
|
|
1616
|
-
],
|
|
1652
|
+
], DataPipeline);
|
|
1617
1653
|
var snapshotTimeframeToStartingTimeframe = (snapshotTimeframe) => {
|
|
1618
1654
|
return snapshotTimeframe.map(([key, seq]) => [
|
|
1619
1655
|
key,
|
|
@@ -1646,7 +1682,6 @@ export {
|
|
|
1646
1682
|
SnapshotStore,
|
|
1647
1683
|
DataServiceSubscriptions,
|
|
1648
1684
|
DataServiceImpl,
|
|
1649
|
-
|
|
1650
|
-
DataPipelineControllerImpl
|
|
1685
|
+
DataPipeline
|
|
1651
1686
|
};
|
|
1652
|
-
//# sourceMappingURL=chunk-
|
|
1687
|
+
//# sourceMappingURL=chunk-EM5HSJ7J.mjs.map
|