@cadenza.io/core 3.19.2 → 3.19.3
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/index.d.mts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +37 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +37 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1272,6 +1272,36 @@ var SignalBroker = class _SignalBroker {
|
|
|
1272
1272
|
setVerbose(value) {
|
|
1273
1273
|
this.verbose = value;
|
|
1274
1274
|
}
|
|
1275
|
+
// Dor debugging
|
|
1276
|
+
logMemoryFootprint(label = "current") {
|
|
1277
|
+
console.log(`[${label}] SignalBroker state sizes:`);
|
|
1278
|
+
console.log(` \u2022 signalObservers entries: ${this.signalObservers.size}`);
|
|
1279
|
+
console.log(
|
|
1280
|
+
` \u2022 emittedSignalsRegistry size: ${this.emittedSignalsRegistry.size}`
|
|
1281
|
+
);
|
|
1282
|
+
let totalSquashContexts = 0;
|
|
1283
|
+
let totalSquashGroups = 0;
|
|
1284
|
+
for (const groups of this.strategyData.values()) {
|
|
1285
|
+
totalSquashGroups += groups.size;
|
|
1286
|
+
for (const data of groups.values()) {
|
|
1287
|
+
totalSquashContexts += data.contexts.length;
|
|
1288
|
+
}
|
|
1289
|
+
}
|
|
1290
|
+
console.log(` \u2022 Active squash groups: ${totalSquashGroups}`);
|
|
1291
|
+
console.log(` \u2022 Total queued squash contexts: ${totalSquashContexts}`);
|
|
1292
|
+
let totalDebouncers = this.debouncedEmitters.size;
|
|
1293
|
+
console.log(` \u2022 Active debouncers: ${totalDebouncers}`);
|
|
1294
|
+
let totalThrottleQueues = 0;
|
|
1295
|
+
for (const q of this.throttleQueues.values()) {
|
|
1296
|
+
totalThrottleQueues += q.length;
|
|
1297
|
+
}
|
|
1298
|
+
console.log(` \u2022 Total items in throttle queues: ${totalThrottleQueues}`);
|
|
1299
|
+
let totalScheduled = 0;
|
|
1300
|
+
for (const bucket of this.scheduledBuckets.values()) {
|
|
1301
|
+
totalScheduled += bucket.length;
|
|
1302
|
+
}
|
|
1303
|
+
console.log(` \u2022 Pending scheduled items: ${totalScheduled}`);
|
|
1304
|
+
}
|
|
1275
1305
|
/**
|
|
1276
1306
|
* Validates the provided signal name string to ensure it adheres to specific formatting rules.
|
|
1277
1307
|
* Throws an error if any of the validation checks fail.
|
|
@@ -1467,7 +1497,8 @@ var SignalBroker = class _SignalBroker {
|
|
|
1467
1497
|
delay = options.exactDateTime.getTime() - Date.now();
|
|
1468
1498
|
}
|
|
1469
1499
|
delay = Math.max(0, delay);
|
|
1470
|
-
const
|
|
1500
|
+
const dueAt = Date.now() + delay;
|
|
1501
|
+
const bucketKey = Math.ceil(dueAt / 100) * 100;
|
|
1471
1502
|
let bucket = this.scheduledBuckets.get(bucketKey);
|
|
1472
1503
|
if (!bucket) {
|
|
1473
1504
|
bucket = [];
|
|
@@ -5967,8 +5998,11 @@ var Cadenza = class {
|
|
|
5967
5998
|
static emit(event, data = {}, options = {}) {
|
|
5968
5999
|
this.signalBroker?.emit(event, data, options);
|
|
5969
6000
|
}
|
|
5970
|
-
static schedule(
|
|
5971
|
-
this.signalBroker?.schedule(
|
|
6001
|
+
static schedule(signalName, context, delayMs, exactDateTime) {
|
|
6002
|
+
this.signalBroker?.schedule(signalName, context, {
|
|
6003
|
+
delayMs,
|
|
6004
|
+
exactDateTime
|
|
6005
|
+
});
|
|
5972
6006
|
}
|
|
5973
6007
|
static interval(taskName, context, intervalMs, leading = false, startDateTime) {
|
|
5974
6008
|
this.signalBroker?.interval(
|