@rotorsoft/act 1.33.18 → 1.33.20
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/.tsbuildinfo +1 -1
- package/dist/@types/act.d.ts +4 -4
- package/dist/@types/config.d.ts +2 -2
- package/dist/@types/internal/correlate-cycle.d.ts.map +1 -1
- package/dist/@types/internal/drain-cycle.d.ts.map +1 -1
- package/dist/@types/internal/settle.d.ts +2 -3
- package/dist/@types/internal/settle.d.ts.map +1 -1
- package/dist/@types/ports.d.ts +1 -1
- package/dist/@types/types/reaction.d.ts +4 -4
- package/dist/@types/utils.d.ts +5 -9
- package/dist/@types/utils.d.ts.map +1 -1
- package/dist/{chunk-3OTABSIB.js → chunk-5Z53Y7SG.js} +2 -2
- package/dist/chunk-5Z53Y7SG.js.map +1 -0
- package/dist/{chunk-N7K4FQEM.cjs → chunk-DVYTKZD5.cjs} +1 -1
- package/dist/{chunk-N7K4FQEM.cjs.map → chunk-DVYTKZD5.cjs.map} +1 -1
- package/dist/{chunk-OYR5RIFE.cjs → chunk-GEUBNZ3B.cjs} +13 -13
- package/dist/chunk-GEUBNZ3B.cjs.map +1 -0
- package/dist/{chunk-SD7SW47Z.js → chunk-HEHGZHHA.js} +1 -1
- package/dist/{chunk-SD7SW47Z.js.map → chunk-HEHGZHHA.js.map} +1 -1
- package/dist/index.cjs +154 -158
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +15 -19
- package/dist/index.js.map +1 -1
- package/dist/test/index.cjs +4 -4
- package/dist/test/index.js +2 -2
- package/dist/types/index.cjs +2 -2
- package/dist/types/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-3OTABSIB.js.map +0 -1
- package/dist/chunk-OYR5RIFE.cjs.map +0 -1
package/dist/index.js
CHANGED
|
@@ -40,7 +40,7 @@ import {
|
|
|
40
40
|
sleep,
|
|
41
41
|
store,
|
|
42
42
|
validate
|
|
43
|
-
} from "./chunk-
|
|
43
|
+
} from "./chunk-5Z53Y7SG.js";
|
|
44
44
|
import {
|
|
45
45
|
ActorSchema,
|
|
46
46
|
CausationEventSchema,
|
|
@@ -70,7 +70,7 @@ import {
|
|
|
70
70
|
pii_fields,
|
|
71
71
|
pii_schemas,
|
|
72
72
|
sensitive
|
|
73
|
-
} from "./chunk-
|
|
73
|
+
} from "./chunk-HEHGZHHA.js";
|
|
74
74
|
|
|
75
75
|
// src/signals.ts
|
|
76
76
|
process.once("SIGINT", async (arg) => {
|
|
@@ -1177,7 +1177,7 @@ var CorrelateCycle = class {
|
|
|
1177
1177
|
_restoring = false;
|
|
1178
1178
|
_init_promise;
|
|
1179
1179
|
// Bounded by `maxSubscribedStreams`; static records live apart so eviction
|
|
1180
|
-
// never
|
|
1180
|
+
// never lets a resolution re-lane them.
|
|
1181
1181
|
_dynamic_subscriptions;
|
|
1182
1182
|
_static_subscriptions = /* @__PURE__ */ new Map();
|
|
1183
1183
|
_patterns = new LruMap(PATTERN_CACHE_SIZE);
|
|
@@ -1226,7 +1226,6 @@ var CorrelateCycle = class {
|
|
|
1226
1226
|
this._checkpoint = correlated_at >= 0 ? correlated_at : Math.max(-1, watermark - COLD_START_BACK_SCAN);
|
|
1227
1227
|
for (const { stream, priority = 0, lane } of this._static_targets) {
|
|
1228
1228
|
this._static_subscriptions.set(stream, {
|
|
1229
|
-
floor: Number.POSITIVE_INFINITY,
|
|
1230
1229
|
priority,
|
|
1231
1230
|
lane
|
|
1232
1231
|
});
|
|
@@ -1330,9 +1329,10 @@ var CorrelateCycle = class {
|
|
|
1330
1329
|
);
|
|
1331
1330
|
lane = void 0;
|
|
1332
1331
|
}
|
|
1333
|
-
const
|
|
1332
|
+
const fixed = this._static_subscriptions.get(resolved.target);
|
|
1333
|
+
const recorded = fixed ?? this._dynamic_subscriptions.get(resolved.target);
|
|
1334
1334
|
const priority = resolved.priority ?? 0;
|
|
1335
|
-
const upgraded = !recorded || priority > recorded.
|
|
1335
|
+
const upgraded = !recorded || !fixed && priority > recorded.priority;
|
|
1336
1336
|
const carried = upgraded ? { priority, lane } : { priority: recorded.priority, lane: recorded.lane };
|
|
1337
1337
|
const entry = correlated.get(resolved.target) || {
|
|
1338
1338
|
source: resolved.source,
|
|
@@ -1402,7 +1402,6 @@ var CorrelateCycle = class {
|
|
|
1402
1402
|
for (const { stream, priority, lane } of streams) {
|
|
1403
1403
|
if (correlated.get(stream)?.upgraded)
|
|
1404
1404
|
this._dynamic_subscriptions.set(stream, {
|
|
1405
|
-
floor: priority,
|
|
1406
1405
|
priority,
|
|
1407
1406
|
lane
|
|
1408
1407
|
});
|
|
@@ -1431,7 +1430,6 @@ var CorrelateCycle = class {
|
|
|
1431
1430
|
);
|
|
1432
1431
|
if (!row) return;
|
|
1433
1432
|
this._dynamic_subscriptions.set(stream, {
|
|
1434
|
-
floor: row.priority,
|
|
1435
1433
|
priority: row.priority,
|
|
1436
1434
|
lane: row.lane
|
|
1437
1435
|
});
|
|
@@ -2345,15 +2343,14 @@ async function run_drain_cycle(deps, cycle) {
|
|
|
2345
2343
|
return handle({ ...lease, at }, payloads);
|
|
2346
2344
|
})
|
|
2347
2345
|
);
|
|
2348
|
-
const
|
|
2349
|
-
|
|
2350
|
-
);
|
|
2346
|
+
const to_block = handled.filter(({ block: block2 }) => block2).map(({ lease, error }) => ({ ...lease, error }));
|
|
2347
|
+
const blocked = to_block.length ? await ops.block(to_block) : [];
|
|
2351
2348
|
if (blocked.length) deps.on_blocked(blocked);
|
|
2352
2349
|
const submitted = handled.flatMap((h, i) => {
|
|
2353
2350
|
const advance = h.handled > 0 ? h.acked_at : leased[i].at;
|
|
2354
2351
|
return h.defer !== void 0 ? { ...h.lease, at: advance, due: h.defer, retry: -1 } : h.next_attempt_at !== void 0 ? { ...h.lease, at: advance, due: h.next_attempt_at } : h.handled > 0 || !h.error ? { ...h.lease, at: h.acked_at } : [];
|
|
2355
2352
|
});
|
|
2356
|
-
const acked = await ops.ack(submitted);
|
|
2353
|
+
const acked = submitted.length ? await ops.ack(submitted) : [];
|
|
2357
2354
|
const expected = submitted.filter((l) => l.due === void 0).length;
|
|
2358
2355
|
if (acked.length < expected)
|
|
2359
2356
|
log().warn(
|
|
@@ -2856,9 +2853,8 @@ var SettleLoop = class {
|
|
|
2856
2853
|
* `debounceMs` brings it forward), and a call during a running cycle
|
|
2857
2854
|
* queues one more pass after it. Callers pass options, which the next
|
|
2858
2855
|
* pass uses; internal wake-ups pass none, so they never discard a
|
|
2859
|
-
* caller's. The cycle runs correlate→drain
|
|
2860
|
-
*
|
|
2861
|
-
* no streams leased) or `maxPasses` is reached, then emits the
|
|
2856
|
+
* caller's. The cycle runs correlate→drain passes until one makes no
|
|
2857
|
+
* progress (see {@link SettleOptions.maxPasses}), then emits the
|
|
2862
2858
|
* `"settled"` lifecycle event via {@link SettleDeps.on_settled}.
|
|
2863
2859
|
*/
|
|
2864
2860
|
schedule(options) {
|
|
@@ -3737,8 +3733,8 @@ var Act = class {
|
|
|
3737
3733
|
* `__snapshot__` events (counted in the result); `on_progress`
|
|
3738
3734
|
* fires once per event.
|
|
3739
3735
|
* @param sink - Where the events land. Defaults to this Act's store.
|
|
3740
|
-
* @returns {@link ScanResult}
|
|
3741
|
-
*
|
|
3736
|
+
* @returns The {@link ScanResult}: what was kept, migrated and dropped,
|
|
3737
|
+
* and how long it took.
|
|
3742
3738
|
*
|
|
3743
3739
|
* @example Restore a CSV backup into the connected store
|
|
3744
3740
|
* ```typescript
|
|
@@ -3908,8 +3904,8 @@ var Act = class {
|
|
|
3908
3904
|
* `unblock()`, `restore()`) schedules this on its own unless the app
|
|
3909
3905
|
* sets `autoSettle: false`. Call it at startup, to run what was pending
|
|
3910
3906
|
* before a restart, or with options for the next pass; the scheduling
|
|
3911
|
-
* rule is in the event-sourcing docs (§ settle). Runs correlate→drain
|
|
3912
|
-
*
|
|
3907
|
+
* rule is in the event-sourcing docs (§ settle). Runs correlate→drain
|
|
3908
|
+
* passes until one makes no progress (see {@link SettleOptions.maxPasses}),
|
|
3913
3909
|
* then emits the `"settled"` lifecycle event, so one call fully catches
|
|
3914
3910
|
* up paginated streams without forcing callers to loop.
|
|
3915
3911
|
*
|