@dxos/echo-pipeline 0.3.3-main.f2ca85a → 0.3.3-main.f5c635b
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-7IXNAFKL.mjs → chunk-KD6OVLI6.mjs} +74 -16
- package/dist/lib/browser/chunk-KD6OVLI6.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +1 -1
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/testing/index.mjs +4 -2
- package/dist/lib/browser/testing/index.mjs.map +3 -3
- package/dist/lib/node/index.cjs +118 -60
- package/dist/lib/node/index.cjs.map +3 -3
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/testing/index.cjs +126 -66
- package/dist/lib/node/testing/index.cjs.map +3 -3
- package/dist/types/src/db-host/data-service-host.d.ts +10 -2
- package/dist/types/src/db-host/data-service-host.d.ts.map +1 -1
- package/dist/types/src/db-host/database-host.d.ts +2 -2
- package/dist/types/src/db-host/database-host.d.ts.map +1 -1
- package/package.json +31 -31
- package/src/db-host/data-service-host.ts +90 -9
- package/src/db-host/database-host.ts +9 -3
- package/src/testing/database-test-rig.ts +1 -1
- package/dist/lib/browser/chunk-7IXNAFKL.mjs.map +0 -7
package/dist/lib/node/index.cjs
CHANGED
|
@@ -91,6 +91,7 @@ var createMappedFeedWriter = (mapper, writer) => {
|
|
|
91
91
|
};
|
|
92
92
|
|
|
93
93
|
// packages/core/echo/echo-pipeline/src/db-host/data-service-host.ts
|
|
94
|
+
var import_async = require("@dxos/async");
|
|
94
95
|
var import_codec_protobuf = require("@dxos/codec-protobuf");
|
|
95
96
|
var import_context = require("@dxos/context");
|
|
96
97
|
var import_echo_db = require("@dxos/echo-db");
|
|
@@ -99,12 +100,14 @@ var import_log = require("@dxos/log");
|
|
|
99
100
|
var import_service = require("@dxos/protocols/proto/dxos/echo/service");
|
|
100
101
|
var import_util = require("@dxos/util");
|
|
101
102
|
var __dxlog_file2 = "/home/runner/work/dxos/dxos/packages/core/echo/echo-pipeline/src/db-host/data-service-host.ts";
|
|
103
|
+
var MUTATION_LIMIT_PER_OBJECT = 10;
|
|
102
104
|
var DataServiceHost = class {
|
|
103
|
-
constructor(_itemManager, _itemDemuxer, _flush, _writeStream) {
|
|
105
|
+
constructor(_itemManager, _itemDemuxer, _flush, _writeStream, _opts = {}) {
|
|
104
106
|
this._itemManager = _itemManager;
|
|
105
107
|
this._itemDemuxer = _itemDemuxer;
|
|
106
108
|
this._flush = _flush;
|
|
107
109
|
this._writeStream = _writeStream;
|
|
110
|
+
this._opts = _opts;
|
|
108
111
|
this._ctx = new import_context.Context();
|
|
109
112
|
this._clientTagMap = new import_util.ComplexMap(([feedKey, seq]) => `${feedKey.toHex()}:${seq}`);
|
|
110
113
|
}
|
|
@@ -113,6 +116,9 @@ var DataServiceHost = class {
|
|
|
113
116
|
async close() {
|
|
114
117
|
await this._ctx.dispose();
|
|
115
118
|
}
|
|
119
|
+
get _deferEvents() {
|
|
120
|
+
return this._opts.deferEvents ?? true;
|
|
121
|
+
}
|
|
116
122
|
/**
|
|
117
123
|
* Real-time subscription to data objects in a space.
|
|
118
124
|
*/
|
|
@@ -125,7 +131,43 @@ var DataServiceHost = class {
|
|
|
125
131
|
objects
|
|
126
132
|
}
|
|
127
133
|
});
|
|
134
|
+
const updateScheduler = new import_async.UpdateScheduler(ctx, async () => {
|
|
135
|
+
flushPendingUpdate();
|
|
136
|
+
}, {
|
|
137
|
+
maxFrequency: 10
|
|
138
|
+
});
|
|
139
|
+
const pendingUpdates = [];
|
|
140
|
+
const mutationsPerObject = /* @__PURE__ */ new Map();
|
|
141
|
+
const clearPendingUpdates = () => {
|
|
142
|
+
pendingUpdates.length = 0;
|
|
143
|
+
mutationsPerObject.clear();
|
|
144
|
+
};
|
|
145
|
+
const flushPendingUpdate = () => {
|
|
146
|
+
const stagedEvents = [];
|
|
147
|
+
const objectsWithSnapshots = /* @__PURE__ */ new Set();
|
|
148
|
+
for (const [id, count] of mutationsPerObject) {
|
|
149
|
+
if (count >= MUTATION_LIMIT_PER_OBJECT) {
|
|
150
|
+
objectsWithSnapshots.add(id);
|
|
151
|
+
const entity = this._itemManager.entities.get(id);
|
|
152
|
+
if (entity) {
|
|
153
|
+
stagedEvents.push(entity.createSnapshot());
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
for (const obj of pendingUpdates) {
|
|
158
|
+
if (!objectsWithSnapshots.has(obj.objectId)) {
|
|
159
|
+
stagedEvents.push(obj);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
next({
|
|
163
|
+
batch: {
|
|
164
|
+
objects: stagedEvents
|
|
165
|
+
}
|
|
166
|
+
});
|
|
167
|
+
clearPendingUpdates();
|
|
168
|
+
};
|
|
128
169
|
this._itemDemuxer.snapshot.on(ctx, (snapshot) => {
|
|
170
|
+
clearPendingUpdates();
|
|
129
171
|
next({
|
|
130
172
|
action: import_service.EchoEvent.DatabaseAction.RESET,
|
|
131
173
|
batch: {
|
|
@@ -137,7 +179,7 @@ var DataServiceHost = class {
|
|
|
137
179
|
const { batch, meta } = message;
|
|
138
180
|
(0, import_invariant2.invariant)(!meta.clientTag, "Unexpected client tag in mutation message", {
|
|
139
181
|
F: __dxlog_file2,
|
|
140
|
-
L:
|
|
182
|
+
L: 131,
|
|
141
183
|
S: this,
|
|
142
184
|
A: [
|
|
143
185
|
"!(meta as any).clientTag",
|
|
@@ -149,7 +191,7 @@ var DataServiceHost = class {
|
|
|
149
191
|
meta
|
|
150
192
|
}, {
|
|
151
193
|
F: __dxlog_file2,
|
|
152
|
-
L:
|
|
194
|
+
L: 132,
|
|
153
195
|
S: this,
|
|
154
196
|
C: (f, a) => f(...a)
|
|
155
197
|
});
|
|
@@ -163,21 +205,37 @@ var DataServiceHost = class {
|
|
|
163
205
|
});
|
|
164
206
|
});
|
|
165
207
|
if (clientTag) {
|
|
208
|
+
flushPendingUpdate();
|
|
166
209
|
(0, import_echo_db.tagMutationsInBatch)(batch, clientTag, 0);
|
|
210
|
+
next({
|
|
211
|
+
clientTag,
|
|
212
|
+
feedKey: message.meta.feedKey,
|
|
213
|
+
seq: message.meta.seq,
|
|
214
|
+
batch
|
|
215
|
+
});
|
|
216
|
+
} else {
|
|
217
|
+
for (const obj of batch.objects ?? []) {
|
|
218
|
+
const newCount = (mutationsPerObject.get(obj.objectId) ?? 0) + 1;
|
|
219
|
+
mutationsPerObject.set(obj.objectId, newCount);
|
|
220
|
+
}
|
|
221
|
+
for (const obj of batch.objects ?? []) {
|
|
222
|
+
if ((mutationsPerObject.get(obj.objectId) ?? 0) < MUTATION_LIMIT_PER_OBJECT) {
|
|
223
|
+
pendingUpdates.push(obj);
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
if (this._deferEvents) {
|
|
227
|
+
updateScheduler.trigger();
|
|
228
|
+
} else {
|
|
229
|
+
flushPendingUpdate();
|
|
230
|
+
}
|
|
167
231
|
}
|
|
168
|
-
next({
|
|
169
|
-
clientTag,
|
|
170
|
-
feedKey: message.meta.feedKey,
|
|
171
|
-
seq: message.meta.seq,
|
|
172
|
-
batch
|
|
173
|
-
});
|
|
174
232
|
});
|
|
175
233
|
});
|
|
176
234
|
}
|
|
177
235
|
async write(request) {
|
|
178
236
|
(0, import_invariant2.invariant)(!this._ctx.disposed, "Cannot write to closed DataServiceHost", {
|
|
179
237
|
F: __dxlog_file2,
|
|
180
|
-
L:
|
|
238
|
+
L: 177,
|
|
181
239
|
S: this,
|
|
182
240
|
A: [
|
|
183
241
|
"!this._ctx.disposed",
|
|
@@ -186,7 +244,7 @@ var DataServiceHost = class {
|
|
|
186
244
|
});
|
|
187
245
|
(0, import_invariant2.invariant)(this._writeStream, "Cannot write mutations in readonly mode", {
|
|
188
246
|
F: __dxlog_file2,
|
|
189
|
-
L:
|
|
247
|
+
L: 178,
|
|
190
248
|
S: this,
|
|
191
249
|
A: [
|
|
192
250
|
"this._writeStream",
|
|
@@ -198,7 +256,7 @@ var DataServiceHost = class {
|
|
|
198
256
|
objectCount: request.batch.objects?.length ?? 0
|
|
199
257
|
}, {
|
|
200
258
|
F: __dxlog_file2,
|
|
201
|
-
L:
|
|
259
|
+
L: 180,
|
|
202
260
|
S: this,
|
|
203
261
|
C: (f, a) => f(...a)
|
|
204
262
|
});
|
|
@@ -212,7 +270,7 @@ var DataServiceHost = class {
|
|
|
212
270
|
seq: receipt2.seq
|
|
213
271
|
}, {
|
|
214
272
|
F: __dxlog_file2,
|
|
215
|
-
L:
|
|
273
|
+
L: 189,
|
|
216
274
|
S: this,
|
|
217
275
|
C: (f, a) => f(...a)
|
|
218
276
|
});
|
|
@@ -269,8 +327,8 @@ var DatabaseHost = class {
|
|
|
269
327
|
createSnapshot() {
|
|
270
328
|
return this._itemDemuxer.createSnapshot();
|
|
271
329
|
}
|
|
272
|
-
createDataServiceHost() {
|
|
273
|
-
return new DataServiceHost(this._itemManager, this._itemDemuxer, this._flush, this._outboundStream ?? void 0);
|
|
330
|
+
createDataServiceHost(opts = {}) {
|
|
331
|
+
return new DataServiceHost(this._itemManager, this._itemDemuxer, this._flush, this._outboundStream ?? void 0, opts);
|
|
274
332
|
}
|
|
275
333
|
};
|
|
276
334
|
|
|
@@ -463,7 +521,7 @@ var DataServiceImpl = class {
|
|
|
463
521
|
|
|
464
522
|
// packages/core/echo/echo-pipeline/src/metadata/metadata-store.ts
|
|
465
523
|
var import_crc_32 = __toESM(require("crc-32"));
|
|
466
|
-
var
|
|
524
|
+
var import_async2 = require("@dxos/async");
|
|
467
525
|
var import_invariant4 = require("@dxos/invariant");
|
|
468
526
|
var import_keys3 = require("@dxos/keys");
|
|
469
527
|
var import_log3 = require("@dxos/log");
|
|
@@ -496,7 +554,7 @@ var MetadataStore = class {
|
|
|
496
554
|
this._metadata = emptyEchoMetadata();
|
|
497
555
|
this._spaceLargeMetadata = new import_util3.ComplexMap(import_keys3.PublicKey.hash);
|
|
498
556
|
this._metadataFile = void 0;
|
|
499
|
-
this.update = new
|
|
557
|
+
this.update = new import_async2.Event();
|
|
500
558
|
}
|
|
501
559
|
get metadata() {
|
|
502
560
|
return this._metadata;
|
|
@@ -755,18 +813,18 @@ var MetadataStore = class {
|
|
|
755
813
|
}
|
|
756
814
|
};
|
|
757
815
|
_ts_decorate([
|
|
758
|
-
|
|
816
|
+
import_async2.synchronized
|
|
759
817
|
], MetadataStore.prototype, "load", null);
|
|
760
818
|
_ts_decorate([
|
|
761
|
-
|
|
819
|
+
import_async2.synchronized
|
|
762
820
|
], MetadataStore.prototype, "_save", null);
|
|
763
821
|
_ts_decorate([
|
|
764
|
-
|
|
822
|
+
import_async2.synchronized
|
|
765
823
|
], MetadataStore.prototype, "_saveSpaceLargeMetadata", null);
|
|
766
824
|
var fromBytesInt32 = (buf) => buf.readInt32LE(0);
|
|
767
825
|
|
|
768
826
|
// packages/core/echo/echo-pipeline/src/pipeline/pipeline.ts
|
|
769
|
-
var
|
|
827
|
+
var import_async4 = require("@dxos/async");
|
|
770
828
|
var import_context3 = require("@dxos/context");
|
|
771
829
|
var import_debug3 = require("@dxos/debug");
|
|
772
830
|
var import_feed_store = require("@dxos/feed-store");
|
|
@@ -807,7 +865,7 @@ var createMessageSelector = (timeframeClock) => {
|
|
|
807
865
|
};
|
|
808
866
|
|
|
809
867
|
// packages/core/echo/echo-pipeline/src/pipeline/timeframe-clock.ts
|
|
810
|
-
var
|
|
868
|
+
var import_async3 = require("@dxos/async");
|
|
811
869
|
var import_debug2 = require("@dxos/debug");
|
|
812
870
|
var import_log5 = require("@dxos/log");
|
|
813
871
|
var import_timeframe = require("@dxos/timeframe");
|
|
@@ -837,7 +895,7 @@ var startAfter = (timeframe) => timeframe.frames().map(([feedKey, index]) => ({
|
|
|
837
895
|
var TimeframeClock = class {
|
|
838
896
|
constructor(_timeframe = new import_timeframe.Timeframe()) {
|
|
839
897
|
this._timeframe = _timeframe;
|
|
840
|
-
this.update = new
|
|
898
|
+
this.update = new import_async3.Event();
|
|
841
899
|
this._pendingTimeframe = _timeframe;
|
|
842
900
|
}
|
|
843
901
|
/**
|
|
@@ -921,7 +979,7 @@ var PipelineState = class {
|
|
|
921
979
|
this._timeframeClock = _timeframeClock;
|
|
922
980
|
this._ctx = new import_context3.Context();
|
|
923
981
|
this.timeframeUpdate = this._timeframeClock.update;
|
|
924
|
-
this.stalled = new
|
|
982
|
+
this.stalled = new import_async4.Event();
|
|
925
983
|
this._startTimeframe = new import_timeframe2.Timeframe();
|
|
926
984
|
this._reachedTarget = false;
|
|
927
985
|
}
|
|
@@ -995,7 +1053,7 @@ var PipelineState = class {
|
|
|
995
1053
|
done = true;
|
|
996
1054
|
this._reachedTarget = true;
|
|
997
1055
|
}),
|
|
998
|
-
(0,
|
|
1056
|
+
(0, import_async4.sleepWithContext)(this._ctx, timeout).then(() => {
|
|
999
1057
|
if (done) {
|
|
1000
1058
|
return;
|
|
1001
1059
|
}
|
|
@@ -1024,8 +1082,8 @@ var Pipeline = class {
|
|
|
1024
1082
|
// External state accessor.
|
|
1025
1083
|
this._state = new PipelineState(this._feeds, this._timeframeClock);
|
|
1026
1084
|
// Waits for the message consumer to process the message and yield control back to the pipeline.
|
|
1027
|
-
this._processingTrigger = new
|
|
1028
|
-
this._pauseTrigger = new
|
|
1085
|
+
this._processingTrigger = new import_async4.Trigger().wake();
|
|
1086
|
+
this._pauseTrigger = new import_async4.Trigger().wake();
|
|
1029
1087
|
// Pending downloads.
|
|
1030
1088
|
this._downloads = new import_util4.ComplexMap((value) => import_keys4.PublicKey.hash(value.key));
|
|
1031
1089
|
this._isStopping = false;
|
|
@@ -1303,23 +1361,23 @@ var Pipeline = class {
|
|
|
1303
1361
|
}
|
|
1304
1362
|
};
|
|
1305
1363
|
_ts_decorate3([
|
|
1306
|
-
|
|
1364
|
+
import_async4.synchronized
|
|
1307
1365
|
], Pipeline.prototype, "start", null);
|
|
1308
1366
|
_ts_decorate3([
|
|
1309
|
-
|
|
1367
|
+
import_async4.synchronized
|
|
1310
1368
|
], Pipeline.prototype, "stop", null);
|
|
1311
1369
|
_ts_decorate3([
|
|
1312
|
-
|
|
1370
|
+
import_async4.synchronized
|
|
1313
1371
|
], Pipeline.prototype, "setCursor", null);
|
|
1314
1372
|
_ts_decorate3([
|
|
1315
|
-
|
|
1373
|
+
import_async4.synchronized
|
|
1316
1374
|
], Pipeline.prototype, "pause", null);
|
|
1317
1375
|
_ts_decorate3([
|
|
1318
|
-
|
|
1376
|
+
import_async4.synchronized
|
|
1319
1377
|
], Pipeline.prototype, "unpause", null);
|
|
1320
1378
|
|
|
1321
1379
|
// packages/core/echo/echo-pipeline/src/space/auth.ts
|
|
1322
|
-
var
|
|
1380
|
+
var import_async5 = require("@dxos/async");
|
|
1323
1381
|
var import_context4 = require("@dxos/context");
|
|
1324
1382
|
var import_crypto2 = require("@dxos/crypto");
|
|
1325
1383
|
var import_invariant7 = require("@dxos/invariant");
|
|
@@ -1377,7 +1435,7 @@ var AuthExtension = class extends import_teleport.RpcExtension {
|
|
|
1377
1435
|
}
|
|
1378
1436
|
async onOpen(context) {
|
|
1379
1437
|
await super.onOpen(context);
|
|
1380
|
-
(0,
|
|
1438
|
+
(0, import_async5.scheduleTask)(this._ctx, async () => {
|
|
1381
1439
|
try {
|
|
1382
1440
|
const challenge = (0, import_crypto2.randomBytes)(32);
|
|
1383
1441
|
const { credential } = await this.rpc.AuthService.authenticate({
|
|
@@ -1402,7 +1460,7 @@ var AuthExtension = class extends import_teleport.RpcExtension {
|
|
|
1402
1460
|
"'credential not verified'"
|
|
1403
1461
|
]
|
|
1404
1462
|
});
|
|
1405
|
-
(0,
|
|
1463
|
+
(0, import_async5.runInContext)(this._ctx, () => this._authParams.onAuthSuccess());
|
|
1406
1464
|
} catch (err) {
|
|
1407
1465
|
(0, import_log7.log)("auth failed", err, {
|
|
1408
1466
|
F: __dxlog_file8,
|
|
@@ -1426,7 +1484,7 @@ var AuthExtension = class extends import_teleport.RpcExtension {
|
|
|
1426
1484
|
};
|
|
1427
1485
|
|
|
1428
1486
|
// packages/core/echo/echo-pipeline/src/space/space.ts
|
|
1429
|
-
var
|
|
1487
|
+
var import_async8 = require("@dxos/async");
|
|
1430
1488
|
var import_invariant9 = require("@dxos/invariant");
|
|
1431
1489
|
var import_log10 = require("@dxos/log");
|
|
1432
1490
|
var import_credentials4 = require("@dxos/protocols/proto/dxos/halo/credentials");
|
|
@@ -1434,7 +1492,7 @@ var import_tracing3 = require("@dxos/tracing");
|
|
|
1434
1492
|
var import_util7 = require("@dxos/util");
|
|
1435
1493
|
|
|
1436
1494
|
// packages/core/echo/echo-pipeline/src/space/control-pipeline.ts
|
|
1437
|
-
var
|
|
1495
|
+
var import_async6 = require("@dxos/async");
|
|
1438
1496
|
var import_context5 = require("@dxos/context");
|
|
1439
1497
|
var import_credentials = require("@dxos/credentials");
|
|
1440
1498
|
var import_keys5 = require("@dxos/keys");
|
|
@@ -1464,8 +1522,8 @@ var ControlPipeline = class ControlPipeline2 {
|
|
|
1464
1522
|
this.onFeedAdmitted = new import_util5.Callback();
|
|
1465
1523
|
this._usage = new import_tracing.TimeUsageCounter();
|
|
1466
1524
|
this._mutations = new import_tracing.TimeSeriesCounter();
|
|
1467
|
-
this._snapshotTask = new
|
|
1468
|
-
await (0,
|
|
1525
|
+
this._snapshotTask = new import_async6.DeferredTask(this._ctx, async () => {
|
|
1526
|
+
await (0, import_async6.sleepWithContext)(this._ctx, CONTROL_PIPELINE_SNAPSHOT_DELAY);
|
|
1469
1527
|
await this._saveSnapshot();
|
|
1470
1528
|
});
|
|
1471
1529
|
this._spaceKey = spaceKey;
|
|
@@ -1688,11 +1746,11 @@ _ts_decorate4([
|
|
|
1688
1746
|
], ControlPipeline.prototype, "_processMessage", null);
|
|
1689
1747
|
ControlPipeline = _ts_decorate4([
|
|
1690
1748
|
import_tracing.trace.resource(),
|
|
1691
|
-
(0,
|
|
1749
|
+
(0, import_async6.trackLeaks)("start", "stop")
|
|
1692
1750
|
], ControlPipeline);
|
|
1693
1751
|
|
|
1694
1752
|
// packages/core/echo/echo-pipeline/src/space/data-pipeline.ts
|
|
1695
|
-
var
|
|
1753
|
+
var import_async7 = require("@dxos/async");
|
|
1696
1754
|
var import_context6 = require("@dxos/context");
|
|
1697
1755
|
var import_credentials3 = require("@dxos/credentials");
|
|
1698
1756
|
var import_echo_db3 = require("@dxos/echo-db");
|
|
@@ -1731,7 +1789,7 @@ var DataPipeline = class DataPipeline2 {
|
|
|
1731
1789
|
this._mutations = new import_tracing2.TimeSeriesCounter();
|
|
1732
1790
|
this.currentEpoch = void 0;
|
|
1733
1791
|
this.appliedEpoch = void 0;
|
|
1734
|
-
this.onNewEpoch = new
|
|
1792
|
+
this.onNewEpoch = new import_async7.Event();
|
|
1735
1793
|
}
|
|
1736
1794
|
get isOpen() {
|
|
1737
1795
|
return this._isOpen;
|
|
@@ -1794,7 +1852,7 @@ var DataPipeline = class DataPipeline2 {
|
|
|
1794
1852
|
this.databaseHost = new DatabaseHost(feedWriter, () => this._flush());
|
|
1795
1853
|
this.itemManager = new import_echo_db3.ItemManager(this._params.modelFactory);
|
|
1796
1854
|
await this.databaseHost.open(this.itemManager, this._params.modelFactory);
|
|
1797
|
-
(0,
|
|
1855
|
+
(0, import_async7.scheduleTask)(this._ctx, async () => {
|
|
1798
1856
|
await this._consumePipeline();
|
|
1799
1857
|
});
|
|
1800
1858
|
this._isOpen = true;
|
|
@@ -1913,7 +1971,7 @@ var DataPipeline = class DataPipeline2 {
|
|
|
1913
1971
|
span.end();
|
|
1914
1972
|
if (++messageCounter > 1e3) {
|
|
1915
1973
|
messageCounter = 0;
|
|
1916
|
-
await (0,
|
|
1974
|
+
await (0, import_async7.sleep)(1);
|
|
1917
1975
|
}
|
|
1918
1976
|
}
|
|
1919
1977
|
}
|
|
@@ -1993,7 +2051,7 @@ var DataPipeline = class DataPipeline2 {
|
|
|
1993
2051
|
}
|
|
1994
2052
|
});
|
|
1995
2053
|
this._epochCtx = ctx;
|
|
1996
|
-
(0,
|
|
2054
|
+
(0, import_async7.scheduleTask)(ctx, async () => {
|
|
1997
2055
|
if (!this._isOpen) {
|
|
1998
2056
|
return;
|
|
1999
2057
|
}
|
|
@@ -2114,19 +2172,19 @@ _ts_decorate5([
|
|
|
2114
2172
|
import_tracing2.trace.metricsCounter()
|
|
2115
2173
|
], DataPipeline.prototype, "_mutations", void 0);
|
|
2116
2174
|
_ts_decorate5([
|
|
2117
|
-
|
|
2175
|
+
import_async7.synchronized
|
|
2118
2176
|
], DataPipeline.prototype, "open", null);
|
|
2119
2177
|
_ts_decorate5([
|
|
2120
|
-
|
|
2178
|
+
import_async7.synchronized
|
|
2121
2179
|
], DataPipeline.prototype, "close", null);
|
|
2122
2180
|
_ts_decorate5([
|
|
2123
|
-
|
|
2181
|
+
import_async7.synchronized
|
|
2124
2182
|
], DataPipeline.prototype, "_processEpoch", null);
|
|
2125
2183
|
_ts_decorate5([
|
|
2126
|
-
|
|
2184
|
+
import_async7.synchronized
|
|
2127
2185
|
], DataPipeline.prototype, "createEpoch", null);
|
|
2128
2186
|
DataPipeline = _ts_decorate5([
|
|
2129
|
-
(0,
|
|
2187
|
+
(0, import_async7.trackLeaks)("open", "close"),
|
|
2130
2188
|
import_tracing2.trace.resource()
|
|
2131
2189
|
], DataPipeline);
|
|
2132
2190
|
|
|
@@ -2144,9 +2202,9 @@ function _ts_decorate6(decorators, target, key, desc) {
|
|
|
2144
2202
|
var __dxlog_file11 = "/home/runner/work/dxos/dxos/packages/core/echo/echo-pipeline/src/space/space.ts";
|
|
2145
2203
|
var Space = class Space2 {
|
|
2146
2204
|
constructor(params) {
|
|
2147
|
-
this._addFeedLock = new
|
|
2205
|
+
this._addFeedLock = new import_async8.Lock();
|
|
2148
2206
|
this.onCredentialProcessed = new import_util7.Callback();
|
|
2149
|
-
this.stateUpdate = new
|
|
2207
|
+
this.stateUpdate = new import_async8.Event();
|
|
2150
2208
|
this._isOpen = false;
|
|
2151
2209
|
(0, import_invariant9.invariant)(params.spaceKey && params.feedProvider, void 0, {
|
|
2152
2210
|
F: __dxlog_file11,
|
|
@@ -2365,22 +2423,22 @@ _ts_decorate6([
|
|
|
2365
2423
|
import_tracing3.trace.info()
|
|
2366
2424
|
], Space.prototype, "key", null);
|
|
2367
2425
|
_ts_decorate6([
|
|
2368
|
-
|
|
2426
|
+
import_async8.synchronized,
|
|
2369
2427
|
import_tracing3.trace.span()
|
|
2370
2428
|
], Space.prototype, "open", null);
|
|
2371
2429
|
_ts_decorate6([
|
|
2372
|
-
|
|
2430
|
+
import_async8.synchronized
|
|
2373
2431
|
], Space.prototype, "close", null);
|
|
2374
2432
|
_ts_decorate6([
|
|
2375
|
-
|
|
2433
|
+
import_async8.synchronized
|
|
2376
2434
|
], Space.prototype, "initializeDataPipeline", null);
|
|
2377
2435
|
Space = _ts_decorate6([
|
|
2378
|
-
(0,
|
|
2436
|
+
(0, import_async8.trackLeaks)("open", "close"),
|
|
2379
2437
|
import_tracing3.trace.resource()
|
|
2380
2438
|
], Space);
|
|
2381
2439
|
|
|
2382
2440
|
// packages/core/echo/echo-pipeline/src/space/space-manager.ts
|
|
2383
|
-
var
|
|
2441
|
+
var import_async9 = require("@dxos/async");
|
|
2384
2442
|
var import_debug4 = require("@dxos/debug");
|
|
2385
2443
|
var import_keys7 = require("@dxos/keys");
|
|
2386
2444
|
var import_log12 = require("@dxos/log");
|
|
@@ -2678,13 +2736,13 @@ var SpaceManager = class SpaceManager2 {
|
|
|
2678
2736
|
}
|
|
2679
2737
|
};
|
|
2680
2738
|
_ts_decorate8([
|
|
2681
|
-
|
|
2739
|
+
import_async9.synchronized
|
|
2682
2740
|
], SpaceManager.prototype, "open", null);
|
|
2683
2741
|
_ts_decorate8([
|
|
2684
|
-
|
|
2742
|
+
import_async9.synchronized
|
|
2685
2743
|
], SpaceManager.prototype, "close", null);
|
|
2686
2744
|
SpaceManager = _ts_decorate8([
|
|
2687
|
-
(0,
|
|
2745
|
+
(0, import_async9.trackLeaks)("open", "close")
|
|
2688
2746
|
], SpaceManager);
|
|
2689
2747
|
// Annotate the CommonJS export names for ESM import in node:
|
|
2690
2748
|
0 && (module.exports = {
|