@dxos/echo-pipeline 0.4.10-main.3040945 → 0.4.10-main.35b4a08
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-RA6MLCZM.mjs → chunk-Y5YOH4CA.mjs} +27 -13
- package/dist/lib/browser/{chunk-RA6MLCZM.mjs.map → chunk-Y5YOH4CA.mjs.map} +3 -3
- package/dist/lib/browser/index.mjs +1 -1
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/testing/index.mjs +1 -1
- package/dist/lib/node/{chunk-KGIYLJBT.cjs → chunk-ONMB6ZZF.cjs} +33 -19
- package/dist/lib/node/chunk-ONMB6ZZF.cjs.map +7 -0
- package/dist/lib/node/index.cjs +21 -21
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/testing/index.cjs +11 -11
- package/dist/types/src/space/space.d.ts +8 -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/package.json +30 -30
- package/src/space/space.test.ts +7 -7
- package/src/space/space.ts +21 -6
- package/dist/lib/node/chunk-KGIYLJBT.cjs.map +0 -7
|
@@ -1143,7 +1143,6 @@ var AuthExtension = class extends RpcExtension {
|
|
|
1143
1143
|
|
|
1144
1144
|
// packages/core/echo/echo-pipeline/src/space/space.ts
|
|
1145
1145
|
import { Event as Event4, Mutex, synchronized as synchronized3, trackLeaks as trackLeaks2 } from "@dxos/async";
|
|
1146
|
-
import { Resource, LifecycleState } from "@dxos/context";
|
|
1147
1146
|
import { invariant as invariant6 } from "@dxos/invariant";
|
|
1148
1147
|
import { log as log7, logInfo } from "@dxos/log";
|
|
1149
1148
|
import { AdmittedFeed as AdmittedFeed2 } from "@dxos/protocols/proto/dxos/halo/credentials";
|
|
@@ -1423,12 +1422,12 @@ function _ts_decorate5(decorators, target, key, desc) {
|
|
|
1423
1422
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
1424
1423
|
}
|
|
1425
1424
|
var __dxlog_file8 = "/home/runner/work/dxos/dxos/packages/core/echo/echo-pipeline/src/space/space.ts";
|
|
1426
|
-
var Space = class
|
|
1425
|
+
var Space = class {
|
|
1427
1426
|
constructor(params) {
|
|
1428
|
-
super();
|
|
1429
1427
|
this._addFeedMutex = new Mutex();
|
|
1430
1428
|
this.onCredentialProcessed = new Callback2();
|
|
1431
1429
|
this.stateUpdate = new Event4();
|
|
1430
|
+
this._isOpen = false;
|
|
1432
1431
|
invariant6(params.spaceKey && params.feedProvider, void 0, {
|
|
1433
1432
|
F: __dxlog_file8,
|
|
1434
1433
|
L: 72,
|
|
@@ -1477,7 +1476,7 @@ var Space = class extends Resource {
|
|
|
1477
1476
|
return this._key;
|
|
1478
1477
|
}
|
|
1479
1478
|
get isOpen() {
|
|
1480
|
-
return this.
|
|
1479
|
+
return this._isOpen;
|
|
1481
1480
|
}
|
|
1482
1481
|
get genesisFeedKey() {
|
|
1483
1482
|
return this._genesisFeedKey;
|
|
@@ -1533,36 +1532,50 @@ var Space = class extends Resource {
|
|
|
1533
1532
|
getControlFeeds() {
|
|
1534
1533
|
return Array.from(this._controlPipeline.spaceState.feeds.values());
|
|
1535
1534
|
}
|
|
1536
|
-
|
|
1535
|
+
/**
|
|
1536
|
+
* Use for diagnostics.
|
|
1537
|
+
*/
|
|
1538
|
+
// getDataFeeds(): FeedInfo[] {
|
|
1539
|
+
// return this._dataPipeline?.getFeeds();
|
|
1540
|
+
// }
|
|
1541
|
+
async open(ctx) {
|
|
1537
1542
|
log7("opening...", void 0, {
|
|
1538
1543
|
F: __dxlog_file8,
|
|
1539
|
-
L:
|
|
1544
|
+
L: 174,
|
|
1540
1545
|
S: this,
|
|
1541
1546
|
C: (f, a) => f(...a)
|
|
1542
1547
|
});
|
|
1548
|
+
if (this._isOpen) {
|
|
1549
|
+
return;
|
|
1550
|
+
}
|
|
1543
1551
|
await this._controlPipeline.start();
|
|
1544
1552
|
await this.protocol.start();
|
|
1553
|
+
this._isOpen = true;
|
|
1545
1554
|
log7("opened", void 0, {
|
|
1546
1555
|
F: __dxlog_file8,
|
|
1547
|
-
L:
|
|
1556
|
+
L: 184,
|
|
1548
1557
|
S: this,
|
|
1549
1558
|
C: (f, a) => f(...a)
|
|
1550
1559
|
});
|
|
1551
1560
|
}
|
|
1552
|
-
async
|
|
1561
|
+
async close() {
|
|
1553
1562
|
log7("closing...", {
|
|
1554
1563
|
key: this._key
|
|
1555
1564
|
}, {
|
|
1556
1565
|
F: __dxlog_file8,
|
|
1557
|
-
L:
|
|
1566
|
+
L: 189,
|
|
1558
1567
|
S: this,
|
|
1559
1568
|
C: (f, a) => f(...a)
|
|
1560
1569
|
});
|
|
1570
|
+
if (!this._isOpen) {
|
|
1571
|
+
return;
|
|
1572
|
+
}
|
|
1561
1573
|
await this.protocol.stop();
|
|
1562
1574
|
await this._controlPipeline.stop();
|
|
1575
|
+
this._isOpen = false;
|
|
1563
1576
|
log7("closed", void 0, {
|
|
1564
1577
|
F: __dxlog_file8,
|
|
1565
|
-
L:
|
|
1578
|
+
L: 199,
|
|
1566
1579
|
S: this,
|
|
1567
1580
|
C: (f, a) => f(...a)
|
|
1568
1581
|
});
|
|
@@ -1579,11 +1592,12 @@ _ts_decorate5([
|
|
|
1579
1592
|
trace2.info()
|
|
1580
1593
|
], Space.prototype, "key", null);
|
|
1581
1594
|
_ts_decorate5([
|
|
1595
|
+
synchronized3,
|
|
1582
1596
|
trace2.span()
|
|
1583
|
-
], Space.prototype, "
|
|
1597
|
+
], Space.prototype, "open", null);
|
|
1584
1598
|
_ts_decorate5([
|
|
1585
1599
|
synchronized3
|
|
1586
|
-
], Space.prototype, "
|
|
1600
|
+
], Space.prototype, "close", null);
|
|
1587
1601
|
Space = _ts_decorate5([
|
|
1588
1602
|
trackLeaks2("open", "close"),
|
|
1589
1603
|
trace2.resource()
|
|
@@ -1924,4 +1938,4 @@ export {
|
|
|
1924
1938
|
SpaceProtocolSession,
|
|
1925
1939
|
SpaceManager
|
|
1926
1940
|
};
|
|
1927
|
-
//# sourceMappingURL=chunk-
|
|
1941
|
+
//# sourceMappingURL=chunk-Y5YOH4CA.mjs.map
|