cross-tab-worker-databus 0.20.61 → 0.20.63
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/CHANGELOG.md +12 -0
- package/dist/centrifuge.js +1 -1
- package/dist/{chunk-VB4P6DS6.js → chunk-ZHCGYGL3.js} +18 -2
- package/dist/chunk-ZHCGYGL3.js.map +7 -0
- package/dist/cjs/centrifuge.cjs +17 -1
- package/dist/cjs/centrifuge.cjs.map +2 -2
- package/dist/cjs/index.cjs +17 -1
- package/dist/cjs/index.cjs.map +2 -2
- package/dist/core/cluster.d.ts +2 -0
- package/dist/core/cluster.d.ts.map +1 -1
- package/dist/core/data-bus.d.ts +26 -2
- package/dist/core/data-bus.d.ts.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/docs/roadmap.md +9 -1
- package/docs/zh/roadmap.md +9 -1
- package/package.json +1 -1
- package/dist/chunk-VB4P6DS6.js.map +0 -7
package/dist/cjs/index.cjs
CHANGED
|
@@ -798,9 +798,11 @@ var WorkerClusterRuntime = class {
|
|
|
798
798
|
this.handlers.onEvent(message.eventType, message.payload, message.sourceWorkerId, message.originTabId);
|
|
799
799
|
return;
|
|
800
800
|
case "REGISTRY":
|
|
801
|
-
default:
|
|
802
801
|
this.reconcile();
|
|
803
802
|
return;
|
|
803
|
+
default:
|
|
804
|
+
this.handlers.onUnknownMessage?.(message);
|
|
805
|
+
return;
|
|
804
806
|
}
|
|
805
807
|
};
|
|
806
808
|
/** Handle a point-to-point CONTROL message (SUBSCRIBE / UNSUBSCRIBE / PUBLISH). */
|
|
@@ -1864,6 +1866,20 @@ var CrossTabDataBus = class {
|
|
|
1864
1866
|
getClusterSnapshot() {
|
|
1865
1867
|
return this.cluster.getSnapshot();
|
|
1866
1868
|
}
|
|
1869
|
+
/** Return a single health snapshot combining lifecycle, recovery, dedup, replay, and cluster state. */
|
|
1870
|
+
getDiagnostics() {
|
|
1871
|
+
let messages = 0;
|
|
1872
|
+
if (this.replayBuffers) for (const buffer of this.replayBuffers.values()) messages += buffer.length;
|
|
1873
|
+
return {
|
|
1874
|
+
status: this.status,
|
|
1875
|
+
started: this.started,
|
|
1876
|
+
transportReady: this.transportReady,
|
|
1877
|
+
recovery: this.getRecoveryStats(),
|
|
1878
|
+
dedup: this.getDedupStats(),
|
|
1879
|
+
replay: { enabled: Boolean(this.replayBuffers), topics: this.replayBuffers?.size ?? 0, messages },
|
|
1880
|
+
cluster: this.cluster.getSnapshot()
|
|
1881
|
+
};
|
|
1882
|
+
}
|
|
1867
1883
|
/**
|
|
1868
1884
|
* Gracefully stop the DataBus: unsubscribe all topics, stop the cluster,
|
|
1869
1885
|
* and close the transport. Idempotent.
|