cross-tab-worker-databus 0.21.31 → 0.21.32
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 +28 -0
- package/dist/centrifuge.js +1 -1
- package/dist/{chunk-M4RO3MVX.js → chunk-PNEOQX4O.js} +2 -38
- package/dist/chunk-PNEOQX4O.js.map +7 -0
- package/dist/cjs/centrifuge.cjs +1 -37
- package/dist/cjs/centrifuge.cjs.map +2 -2
- package/dist/cjs/index.cjs +1 -37
- package/dist/cjs/index.cjs.map +2 -2
- package/dist/core/cluster.d.ts +0 -1
- package/dist/core/cluster.d.ts.map +1 -1
- package/dist/core/trace.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/docs/architecture.md +1 -1
- package/docs/release-checklist.md +1 -1
- package/docs/roadmap.md +10 -2
- package/docs/zh/architecture.md +1 -1
- package/docs/zh/release-checklist.md +1 -1
- package/docs/zh/roadmap.md +10 -2
- package/package.json +1 -1
- package/dist/chunk-M4RO3MVX.js.map +0 -7
package/dist/cjs/centrifuge.cjs
CHANGED
|
@@ -801,19 +801,6 @@ var WorkerClusterRuntime = class {
|
|
|
801
801
|
this.routeOwnerCache.delete(oldest);
|
|
802
802
|
}
|
|
803
803
|
}
|
|
804
|
-
// Concrete topic → the local wildcard pattern that matched it, or `null` for
|
|
805
|
-
// "scanned, nothing matched". UNLIKE the reverse cache below, this map has no cap:
|
|
806
|
-
// it grows one entry per distinct topic this worker publishes, and is cleared only
|
|
807
|
-
// on the two lifecycle teardowns whose `routeOwnerCache.clear()` sits beside each
|
|
808
|
-
// `wildcardPublishCache.clear()`. Measured: 1,200 `publish()` calls on distinct
|
|
809
|
-
// topic names leave `knownTopics` at its 500-entry cap and this map holding 1,200.
|
|
810
|
-
// A cap is not free here, because both halves decide something. Evicting a pattern
|
|
811
|
-
// re-runs the first local dispatch the entry exists to prevent. Evicting a `null`
|
|
812
|
-
// re-scans, and if a wildcard was assigned in the meantime that publication
|
|
813
|
-
// dispatches locally instead of routing by owner — the fan-out a first publication
|
|
814
|
-
// gets. So bounding this map needs a rule about which of the two may be forgotten,
|
|
815
|
-
// not a number; until one is chosen the growth is the honest cost of the memo.
|
|
816
|
-
wildcardPublishCache = /* @__PURE__ */ new Map();
|
|
817
804
|
// Reverse mapping: opaque topicKey → plaintext topic. A bounded cache with
|
|
818
805
|
// FIFO eviction — NOT authoritative. It can hold a topicKey that is also in
|
|
819
806
|
// assignedTopics (the owned guard prevents evicting those), because it is
|
|
@@ -890,7 +877,6 @@ var WorkerClusterRuntime = class {
|
|
|
890
877
|
this.subscribedTopics.clear();
|
|
891
878
|
this.assignedTopics.clear();
|
|
892
879
|
this.routeOwnerCache.clear();
|
|
893
|
-
this.wildcardPublishCache.clear();
|
|
894
880
|
this.knownTopics.clear();
|
|
895
881
|
this.suspended = false;
|
|
896
882
|
}
|
|
@@ -958,7 +944,6 @@ var WorkerClusterRuntime = class {
|
|
|
958
944
|
this.handoffAssignedTopics();
|
|
959
945
|
this.assignedTopics.clear();
|
|
960
946
|
this.routeOwnerCache.clear();
|
|
961
|
-
this.wildcardPublishCache.clear();
|
|
962
947
|
this.removeStorage(this.workerStorageKey(this.workerId));
|
|
963
948
|
this.flushStorage();
|
|
964
949
|
this.notifyRegistry();
|
|
@@ -1065,16 +1050,6 @@ var WorkerClusterRuntime = class {
|
|
|
1065
1050
|
if (this.assignedTopics.has(topicKey)) {
|
|
1066
1051
|
return this.sendControl(this.workerId, CONTROL_ACTION.PUBLISH, topic, topicKey, data, metadata);
|
|
1067
1052
|
}
|
|
1068
|
-
const cachedPattern = this.wildcardPublishCache.get(topic);
|
|
1069
|
-
if (cachedPattern === void 0) {
|
|
1070
|
-
for (const pattern of this.assignedTopics.values()) {
|
|
1071
|
-
if (pattern !== topic && topicMatchesPattern(pattern, topic)) {
|
|
1072
|
-
this.wildcardPublishCache.set(topic, pattern);
|
|
1073
|
-
return this.sendControl(this.workerId, CONTROL_ACTION.PUBLISH, topic, topicKey, data, metadata);
|
|
1074
|
-
}
|
|
1075
|
-
}
|
|
1076
|
-
this.wildcardPublishCache.set(topic, null);
|
|
1077
|
-
}
|
|
1078
1053
|
return this.sendControl(this.resolvePublishTarget(topic, topicKey), CONTROL_ACTION.PUBLISH, topic, topicKey, data, metadata);
|
|
1079
1054
|
}
|
|
1080
1055
|
/**
|
|
@@ -1099,17 +1074,6 @@ var WorkerClusterRuntime = class {
|
|
|
1099
1074
|
this.dispatchLocalPublishBatch(topic, topicKey, items);
|
|
1100
1075
|
return true;
|
|
1101
1076
|
}
|
|
1102
|
-
const cachedPattern = this.wildcardPublishCache.get(topic);
|
|
1103
|
-
if (cachedPattern === void 0) {
|
|
1104
|
-
for (const pattern of this.assignedTopics.values()) {
|
|
1105
|
-
if (pattern !== topic && topicMatchesPattern(pattern, topic)) {
|
|
1106
|
-
this.wildcardPublishCache.set(topic, pattern);
|
|
1107
|
-
this.dispatchLocalPublishBatch(topic, topicKey, items);
|
|
1108
|
-
return true;
|
|
1109
|
-
}
|
|
1110
|
-
}
|
|
1111
|
-
this.wildcardPublishCache.set(topic, null);
|
|
1112
|
-
}
|
|
1113
1077
|
const target = this.resolvePublishTarget(topic, topicKey);
|
|
1114
1078
|
if (target === this.workerId) {
|
|
1115
1079
|
this.dispatchLocalPublishBatch(topic, topicKey, items);
|
|
@@ -2640,7 +2604,7 @@ var SDK_VERSION = (
|
|
|
2640
2604
|
// declaration's type is `string | undefined` and the export's is `string`
|
|
2641
2605
|
// (dropping the conditional is TS2322, measured). Recorded here so the leg reads
|
|
2642
2606
|
// as a shape the harness cannot reach rather than as a case nobody exercised.
|
|
2643
|
-
true ? "0.21.
|
|
2607
|
+
true ? "0.21.32" : ""
|
|
2644
2608
|
);
|
|
2645
2609
|
|
|
2646
2610
|
// src/core/data-bus.ts
|