@rotorsoft/act 1.32.24 → 1.32.26
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 +20 -155
- package/dist/@types/act.d.ts.map +1 -1
- package/dist/@types/adapters/in-memory-store.d.ts +10 -190
- package/dist/@types/adapters/in-memory-store.d.ts.map +1 -1
- package/dist/@types/internal/close-cycle.d.ts +0 -8
- package/dist/@types/internal/close-cycle.d.ts.map +1 -1
- 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/event-sourcing.d.ts.map +1 -1
- package/dist/@types/internal/index.d.ts +1 -1
- package/dist/@types/internal/index.d.ts.map +1 -1
- package/dist/{chunk-OG5O36AJ.js → chunk-QXW3JV2H.js} +21 -240
- package/dist/chunk-QXW3JV2H.js.map +1 -0
- package/dist/index.cjs +153 -488
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +135 -251
- package/dist/index.js.map +1 -1
- package/dist/test/index.cjs +20 -239
- package/dist/test/index.cjs.map +1 -1
- package/dist/test/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-OG5O36AJ.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"correlate-cycle.d.ts","sourceRoot":"","sources":["../../../src/internal/correlate-cycle.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,KAAK,EAEV,KAAK,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"correlate-cycle.d.ts","sourceRoot":"","sources":["../../../src/internal/correlate-cycle.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,KAAK,EAEV,KAAK,EACL,QAAQ,EAER,cAAc,EACd,OAAO,EAGR,MAAM,mBAAmB,CAAC;AAE3B,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAsC3C,6EAA6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C,CA6KD;IAED;;;;OAIG;YACW,OAAO;IAmCrB,2EAA2E;IACrE,mBAAmB,IAAI,OAAO,CAAC,IAAI,CAAC,CAezC;CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"drain-cycle.d.ts","sourceRoot":"","sources":["../../../src/internal/drain-cycle.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,KAAK,EACV,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,KAAK,EACL,YAAY,EAEZ,KAAK,EACL,MAAM,EAEN,eAAe,EACf,QAAQ,
|
|
1
|
+
{"version":3,"file":"drain-cycle.d.ts","sourceRoot":"","sources":["../../../src/internal/drain-cycle.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,KAAK,EACV,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,KAAK,EACL,YAAY,EAEZ,KAAK,EACL,MAAM,EAEN,eAAe,EACf,QAAQ,EAER,cAAc,EACd,OAAO,EACR,MAAM,mBAAmB,CAAC;AAE3B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAQ3D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAK3C,mEAAmE;AACnE,MAAM,MAAM,YAAY,GAAG,QAAQ,CAAC;IAClC,KAAK,EAAE,KAAK,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,sEAAsE;IACtE,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,yEAAyE;IACzE,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,wEAAwE;IACxE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,8EAA8E;IAC9E,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,gGAAgG;IAChG,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC,CAAC;AAEH,oBAAoB;AACpB,MAAM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MAAM,GAAG,SAAS,CAErC;IAED,IAAI,IAAI,IAAI,MAAM,GAAG,SAAS,CAE7B;IAED,qFAAqF;IACrF,KAAK,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAY3B;IAED,IAAI,IAAI,IAAI,CAOX;IAEK,KAAK,CAAC,OAAO,GAAE,YAAiB,GAAG,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAkF/D;CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"event-sourcing.d.ts","sourceRoot":"","sources":["../../../src/internal/event-sourcing.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,KAAK,KAAK,EAAS,MAAM,sBAAsB,CAAC;AAOzD,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"event-sourcing.d.ts","sourceRoot":"","sources":["../../../src/internal/event-sourcing.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,KAAK,KAAK,EAAS,MAAM,sBAAsB,CAAC;AAOzD,OAAO,KAAK,EAEV,SAAS,EACT,SAAS,EAGT,WAAW,EACX,UAAU,EACV,WAAW,EACX,UAAU,EACV,MAAM,EACN,OAAO,EACP,QAAQ,EACR,KAAK,EACL,MAAM,EACP,MAAM,mBAAmB,CAAC;AAK3B;;;;GAIG;AACH,MAAM,MAAM,OAAO,GAAG,CACpB,MAAM,SAAS,MAAM,EACrB,OAAO,SAAS,OAAO,EACvB,QAAQ,SAAS,OAAO,EAExB,EAAE,EAAE,KAAK,CAAC,MAAM,EAAE,OAAO,EAAE,QAAQ,CAAC,EACpC,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,EAChC,KAAK,EAAE,SAAS,CAAC,OAAO,EAAE,MAAM,OAAO,CAAC,KACrC,MAAM,CAAC;AAEZ,0EAA0E;AAC1E,eAAO,MAAM,UAAU,EAAE,OACc,CAAC;AAExC;;;GAGG;AACH,eAA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,CAAC,KAAK,OAAO,CAAC,MAAM,CAAC,GACvE,OAAO,CAAC,IAAI,CAAC,UAAU,EAAE,aAAa,CAAC,CAAC,CAgI1C;AAED;;;GAGG;AACH,wBAAsB,IAAI,CACxB,MAAM,SAAS,MAAM,EACrB,OAAO,SAAS,OAAO,EACvB,QAAQ,SAAS,OAAO,EAExB,EAAE,EAAE,KAAK,CAAC,MAAM,EAAE,OAAO,EAAE,QAAQ,CAAC,EACpC,MAAM,EAAE,UAAU,EAClB,QAAQ,CAAC,EAAE,CAAC,QAAQ,EAAE,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,EACxD,QAAQ,GAAE,OAAoB,GAC7B,OAAO,CAAC,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAqFpC;AAED;;;;GAIG;AACH,wBAAsB,MAAM,CAC1B,MAAM,SAAS,MAAM,EACrB,OAAO,SAAS,OAAO,EACvB,QAAQ,SAAS,OAAO,EACxB,IAAI,SAAS,MAAM,QAAQ,EAE3B,EAAE,EAAE,KAAK,CAAC,MAAM,EAAE,OAAO,EAAE,QAAQ,CAAC,EACpC,MAAM,EAAE,IAAI,EACZ,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,EACjC,OAAO,CAAC,EAAE,SAAS,CAAC,OAAO,CAAC,EAC5B,QAAQ,GAAE,OAAoB,GAC7B,OAAO,CAAC,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC,CA2JtC"}
|
|
@@ -21,7 +21,7 @@ export { type AutoclosePolicy, compile_autoclose_policy, policy_keep_days, polic
|
|
|
21
21
|
export { synthesize_autoclose_reactions } from "./autoclose-reaction.js";
|
|
22
22
|
export { compute_backoff_delay } from "./backoff.js";
|
|
23
23
|
export { CircuitBreaker, type CircuitState } from "./circuit-breaker.js";
|
|
24
|
-
export {
|
|
24
|
+
export { CloseLock, catch_up_correlation, run_close_cycle, } from "./close-cycle.js";
|
|
25
25
|
export { CloseSignal } from "./close-signal.js";
|
|
26
26
|
export { type AutocloseConfig, type CircuitBreakerOptions, DEFAULT_AUTOCLOSE_CYCLE_MINUTES, DEFAULT_BACKOFF, DEFAULT_BLOCK_ON_ERROR, DEFAULT_CLOSE_BATCH_SIZE, DEFAULT_CLOSE_YIELD_MS, DEFAULT_LEASE_MILLIS, DEFAULT_MAX_RETRIES, DEFAULT_MAX_SUBSCRIBED_STREAMS, DEFAULT_SETTLE_DEBOUNCE_MS, type FoldConfig, MAX_SHUTDOWN_GRACE_MS, resolveActConfig, resolveActionConfig, resolveAutocloseConfig, resolveCircuitBreakerConfig, resolveDrainConfig, resolveFoldConfig, resolveLaneConfig, resolveReactionConfig, resolveSettleConfig, resolveShutdownConfig, } from "./config.js";
|
|
27
27
|
export type { StaticTarget } from "./correlate-cycle.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/internal/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnD,OAAO,EACL,KAAK,eAAe,EACpB,wBAAwB,EACxB,gBAAgB,EAChB,qBAAqB,GACtB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,8BAA8B,EAAE,MAAM,yBAAyB,CAAC;AACzE,OAAO,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,KAAK,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACzE,OAAO,EACL,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/internal/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnD,OAAO,EACL,KAAK,eA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AChB,KAAK,YAAY,GAClB,MAAM,kBAAkB,CAAC;AAC1B,YAAY,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACzE,OAAO,EACL,kBAAkB,EAClB,sBAAsB,GACvB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,UAAU,EACV,iBAAiB,EACjB,KAAK,sBAAsB,GAC5B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,KAAK,SAAS,EACd,aAAa,GACd,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC"}
|
|
@@ -242,13 +242,9 @@ var InMemoryStream = class {
|
|
|
242
242
|
_leased_until = void 0;
|
|
243
243
|
_priority = 0;
|
|
244
244
|
_lane = DEFAULT_LANE;
|
|
245
|
-
//
|
|
246
|
-
// stream is held out of `claim` entirely — so a deferred reaction is not
|
|
247
|
-
// re-claimed (and `retry` is never bumped) until its due-time passes. Unlike
|
|
248
|
-
// in-process backoff, this is durable store state shared across workers.
|
|
245
|
+
// While in the future, the stream is held out of `claim`.
|
|
249
246
|
_deferred_at = void 0;
|
|
250
|
-
// Work mark
|
|
251
|
-
// `undefined` means the row was never correlated, so `claim` skips it.
|
|
247
|
+
// Work mark; `undefined` = never correlated, so `claim` skips it.
|
|
252
248
|
_correlated_at = void 0;
|
|
253
249
|
constructor(stream, source, priority = 0, lane = DEFAULT_LANE) {
|
|
254
250
|
this.stream = stream;
|
|
@@ -262,44 +258,28 @@ var InMemoryStream = class {
|
|
|
262
258
|
get lane() {
|
|
263
259
|
return this._lane;
|
|
264
260
|
}
|
|
265
|
-
/**
|
|
261
|
+
/** Replaced on every subscribe, so the current config wins on restart. */
|
|
266
262
|
set lane(value) {
|
|
267
263
|
this._lane = value;
|
|
268
264
|
}
|
|
269
|
-
/**
|
|
270
|
-
* Bump the priority via {@link subscribe}: keeps the maximum across
|
|
271
|
-
* reactions so the highest-priority registrant wins.
|
|
272
|
-
*/
|
|
273
265
|
bump_priority(priority) {
|
|
274
266
|
if (priority > this._priority) this._priority = priority;
|
|
275
267
|
}
|
|
276
268
|
get correlated_at() {
|
|
277
269
|
return this._correlated_at;
|
|
278
270
|
}
|
|
279
|
-
/**
|
|
280
|
-
* Raise the work mark via {@link subscribe}: keeps the maximum, for every
|
|
281
|
-
* value including zero and negatives, so a mark never regresses.
|
|
282
|
-
*/
|
|
271
|
+
/** A mark never regresses, including at zero and negatives. */
|
|
283
272
|
mark(correlated_at) {
|
|
284
273
|
if (this._correlated_at === void 0 || correlated_at > this._correlated_at)
|
|
285
274
|
this._correlated_at = correlated_at;
|
|
286
275
|
}
|
|
287
|
-
/**
|
|
288
|
-
* Set the priority outright via {@link prioritize}: operator
|
|
289
|
-
* runtime override that ignores the build-time `max()` invariant.
|
|
290
|
-
*/
|
|
276
|
+
/** Operator override; ignores the subscribe-time `max()`. */
|
|
291
277
|
set_priority(priority) {
|
|
292
278
|
this._priority = priority;
|
|
293
279
|
}
|
|
294
280
|
get is_available() {
|
|
295
|
-
return !this._blocked && (!this._leased_until || this._leased_until <= /* @__PURE__ */ new Date()) &&
|
|
296
|
-
|
|
297
|
-
}
|
|
298
|
-
/**
|
|
299
|
-
* Hold this stream out of `claim` until `deferred_at` (ms since epoch).
|
|
300
|
-
* Set by a deliberate `defer` outcome — not a failure, so retry/blocked
|
|
301
|
-
* state is untouched. Cleared by ack/block/reset/unblock.
|
|
302
|
-
*/
|
|
281
|
+
return !this._blocked && (!this._leased_until || this._leased_until <= /* @__PURE__ */ new Date()) && (!this._deferred_at || this._deferred_at <= Date.now());
|
|
282
|
+
}
|
|
303
283
|
defer(deferred_at) {
|
|
304
284
|
this._deferred_at = deferred_at;
|
|
305
285
|
this._retry = -1;
|
|
@@ -322,16 +302,9 @@ var InMemoryStream = class {
|
|
|
322
302
|
get leased_until() {
|
|
323
303
|
return this._leased_until;
|
|
324
304
|
}
|
|
325
|
-
/** Persisted next-visit time, or undefined when no active defer. */
|
|
326
305
|
get deferred_at() {
|
|
327
306
|
return this._deferred_at;
|
|
328
307
|
}
|
|
329
|
-
/**
|
|
330
|
-
* Attempt to lease this stream for processing.
|
|
331
|
-
* @param lease - The lease request.
|
|
332
|
-
* @param millis - Lease duration in milliseconds.
|
|
333
|
-
* @returns The granted lease or undefined if blocked.
|
|
334
|
-
*/
|
|
335
308
|
lease(lease, millis) {
|
|
336
309
|
this._leased_by = lease.by;
|
|
337
310
|
this._leased_until = new Date(Date.now() + millis);
|
|
@@ -346,12 +319,7 @@ var InMemoryStream = class {
|
|
|
346
319
|
lane: this._lane
|
|
347
320
|
};
|
|
348
321
|
}
|
|
349
|
-
/**
|
|
350
|
-
* Finalize this stream's lease: ack (advance the watermark) or, when the
|
|
351
|
-
* lease carries a `due` marker, defer (persist the schedule, hold the
|
|
352
|
-
* watermark) — see {@link Store.ack}.
|
|
353
|
-
* @param lease - The lease request.
|
|
354
|
-
*/
|
|
322
|
+
/** Ack, or with `due`, also persist the schedule. See {@link Store.ack}. */
|
|
355
323
|
ack(lease) {
|
|
356
324
|
if (this._leased_by === lease.by) {
|
|
357
325
|
this._leased_by = void 0;
|
|
@@ -376,11 +344,6 @@ var InMemoryStream = class {
|
|
|
376
344
|
};
|
|
377
345
|
}
|
|
378
346
|
}
|
|
379
|
-
/**
|
|
380
|
-
* Block a stream for processing after failing to process and reaching max retries with blocking enabled.
|
|
381
|
-
* @param lease - The lease request.
|
|
382
|
-
* @param error Blocked error message.
|
|
383
|
-
*/
|
|
384
347
|
block(lease, error) {
|
|
385
348
|
if (this._leased_by === lease.by && !this._blocked) {
|
|
386
349
|
this._blocked = true;
|
|
@@ -398,11 +361,7 @@ var InMemoryStream = class {
|
|
|
398
361
|
};
|
|
399
362
|
}
|
|
400
363
|
}
|
|
401
|
-
/**
|
|
402
|
-
* Reset this stream's watermark and state for replay. The retry counter
|
|
403
|
-
* resets to -1 to match the constructor + ack() invariant ("released
|
|
404
|
-
* stream"); the next claim() bumps it to 0 (first attempt).
|
|
405
|
-
*/
|
|
364
|
+
/** Retry resets to -1 (released); the next claim makes it 0. */
|
|
406
365
|
reset() {
|
|
407
366
|
this._at = -1;
|
|
408
367
|
this._retry = -1;
|
|
@@ -412,11 +371,7 @@ var InMemoryStream = class {
|
|
|
412
371
|
this._leased_until = void 0;
|
|
413
372
|
this._deferred_at = void 0;
|
|
414
373
|
}
|
|
415
|
-
/**
|
|
416
|
-
* Clear the blocked flag and lease bookkeeping without touching the
|
|
417
|
-
* watermark. Returns true if the stream was actually blocked (and is
|
|
418
|
-
* now flipped); false otherwise.
|
|
419
|
-
*/
|
|
374
|
+
/** True only when the stream was blocked. */
|
|
420
375
|
unblock() {
|
|
421
376
|
if (!this._blocked) return false;
|
|
422
377
|
this._blocked = false;
|
|
@@ -429,33 +384,17 @@ var InMemoryStream = class {
|
|
|
429
384
|
}
|
|
430
385
|
};
|
|
431
386
|
var InMemoryStore = class {
|
|
432
|
-
// stored events
|
|
433
387
|
_events = [];
|
|
434
|
-
//
|
|
435
|
-
// prune) punch holes in the id sequence, so ids are NOT array indexes and
|
|
436
|
-
// NOT `_events.length`; they only stay sorted ascending in `_events`.
|
|
388
|
+
// Never reused. Deletions punch holes, so ids are not array indexes.
|
|
437
389
|
_next_id = 0;
|
|
438
|
-
// stored stream positions and other metadata
|
|
439
390
|
_streams = /* @__PURE__ */ new Map();
|
|
440
391
|
/** Correlate checkpoint: how far the log has been READ. */
|
|
441
392
|
_correlated_at = -1;
|
|
442
|
-
/**
|
|
443
|
-
* Per-correlator checkpoint and lease, keyed by correlator.
|
|
444
|
-
*
|
|
445
|
-
* Keyed rather than singular because correlators that look for different
|
|
446
|
-
* things read the log for different reasons: sharing one position lets a
|
|
447
|
-
* partial-behaviour worker inherit another's, and sharing one lease lets
|
|
448
|
-
* one starve the other. Callers that supply no correlator use
|
|
449
|
-
* `_correlated_at` instead, the shared checkpoint.
|
|
450
|
-
*/
|
|
393
|
+
/** Per-correlator checkpoint and lease; keyless callers use `_correlated_at`. */
|
|
451
394
|
_correlators = /* @__PURE__ */ new Map();
|
|
452
|
-
// last committed version per stream — O(1) replacement for filter-on-commit
|
|
453
395
|
_stream_versions = /* @__PURE__ */ new Map();
|
|
454
|
-
// stream → (event_id → cloned
|
|
455
|
-
//
|
|
456
|
-
// the `DELETE WHERE stream = ?` scope that durable adapters get from their
|
|
457
|
-
// stream index. Entries exist only for events committed with a non-null
|
|
458
|
-
// `pii` field; absence means "no PII" (returned as `null` on load).
|
|
396
|
+
// stream → (event_id → cloned pii). Two levels so `forget_pii` drops one
|
|
397
|
+
// inner Map. Absence means no PII.
|
|
459
398
|
_pii = /* @__PURE__ */ new Map();
|
|
460
399
|
_reset_indexes() {
|
|
461
400
|
this._events.length = 0;
|
|
@@ -473,10 +412,7 @@ var InMemoryStore = class {
|
|
|
473
412
|
}
|
|
474
413
|
per_stream.set(id, structuredClone(pii));
|
|
475
414
|
}
|
|
476
|
-
// First index whose
|
|
477
|
-
// sorted ascending by id (append-only commits; deletions preserve
|
|
478
|
-
// order), so id-bounded scans binary-search their start instead of
|
|
479
|
-
// assuming id === index — an invariant that truncation breaks.
|
|
415
|
+
// First index whose id is greater than `after` (ids are sorted, not dense).
|
|
480
416
|
_first_index_after(after) {
|
|
481
417
|
let lo = 0;
|
|
482
418
|
let hi = this._events.length;
|
|
@@ -487,32 +423,19 @@ var InMemoryStore = class {
|
|
|
487
423
|
}
|
|
488
424
|
return lo;
|
|
489
425
|
}
|
|
490
|
-
//
|
|
491
|
-
// a caller. Allocation-free for events without PII — by far the common case.
|
|
426
|
+
// Allocation-free for events without PII, the common case.
|
|
492
427
|
_with_pii(e, wanted = true) {
|
|
493
428
|
if (!wanted) return e;
|
|
494
429
|
const pii = this._pii.get(e.stream)?.get(e.id);
|
|
495
430
|
return pii ? { ...e, pii } : e;
|
|
496
431
|
}
|
|
497
|
-
/**
|
|
498
|
-
* Dispose of the store and clear all events.
|
|
499
|
-
* @returns Promise that resolves when disposal is complete.
|
|
500
|
-
*/
|
|
501
432
|
async dispose() {
|
|
502
433
|
await sleep();
|
|
503
434
|
this._reset_indexes();
|
|
504
435
|
}
|
|
505
|
-
/**
|
|
506
|
-
* Seed the store with initial data (no-op for in-memory).
|
|
507
|
-
* @returns Promise that resolves when seeding is complete.
|
|
508
|
-
*/
|
|
509
436
|
async seed() {
|
|
510
437
|
await sleep();
|
|
511
438
|
}
|
|
512
|
-
/**
|
|
513
|
-
* Drop all data from the store.
|
|
514
|
-
* @returns Promise that resolves when the store is cleared.
|
|
515
|
-
*/
|
|
516
439
|
async drop() {
|
|
517
440
|
await sleep();
|
|
518
441
|
this._reset_indexes();
|
|
@@ -532,12 +455,7 @@ var InMemoryStore = class {
|
|
|
532
455
|
_stream_matches(pattern, query, stream) {
|
|
533
456
|
return query.stream_exact ? stream === pattern : RegExp(pattern).test(stream);
|
|
534
457
|
}
|
|
535
|
-
/**
|
|
536
|
-
* Index of the latest snapshot of the queried stream, or -1. `with_snaps`
|
|
537
|
-
* on an exact single stream resumes there, so earlier events aren't read.
|
|
538
|
-
* The orchestrator asks only for unbounded current-state loads, so the
|
|
539
|
-
* floor applies whenever asked; an explicit `after` wins over it.
|
|
540
|
-
*/
|
|
458
|
+
/** Index of the stream's latest snapshot, or -1; an explicit `after` wins. */
|
|
541
459
|
_snap_floor(query) {
|
|
542
460
|
if (!query?.with_snaps || !query.stream_exact || query.stream === void 0 || query.after !== void 0)
|
|
543
461
|
return -1;
|
|
@@ -547,12 +465,6 @@ var InMemoryStore = class {
|
|
|
547
465
|
}
|
|
548
466
|
return -1;
|
|
549
467
|
}
|
|
550
|
-
/**
|
|
551
|
-
* Query events in the store, optionally filtered by query options.
|
|
552
|
-
* @param callback - Function to call for each event.
|
|
553
|
-
* @param query - Optional query options.
|
|
554
|
-
* @returns The number of events processed.
|
|
555
|
-
*/
|
|
556
468
|
async query(callback, query) {
|
|
557
469
|
await sleep();
|
|
558
470
|
const floor = this._snap_floor(query);
|
|
@@ -571,15 +483,6 @@ var InMemoryStore = class {
|
|
|
571
483
|
}
|
|
572
484
|
return count;
|
|
573
485
|
}
|
|
574
|
-
/**
|
|
575
|
-
* Commit one or more events to a stream.
|
|
576
|
-
* @param stream - The stream name.
|
|
577
|
-
* @param msgs - The events/messages to commit.
|
|
578
|
-
* @param meta - Event metadata.
|
|
579
|
-
* @param expectedVersion - Optional optimistic concurrency check.
|
|
580
|
-
* @returns The committed events with metadata.
|
|
581
|
-
* @throws ConcurrencyError if expectedVersion does not match.
|
|
582
|
-
*/
|
|
583
486
|
async commit(stream, msgs, meta, expectedVersion) {
|
|
584
487
|
await sleep();
|
|
585
488
|
const current_version = this._stream_versions.get(stream) ?? -1;
|
|
@@ -610,15 +513,6 @@ var InMemoryStore = class {
|
|
|
610
513
|
this._stream_versions.set(stream, version - 1);
|
|
611
514
|
return committed;
|
|
612
515
|
}
|
|
613
|
-
/**
|
|
614
|
-
* Atomically discovers and leases streams for processing.
|
|
615
|
-
* Fuses poll + lease into a single operation.
|
|
616
|
-
* @param lagging - Max streams from lagging frontier.
|
|
617
|
-
* @param leading - Max streams from leading frontier.
|
|
618
|
-
* @param by - Lease holder identifier.
|
|
619
|
-
* @param millis - Lease duration in milliseconds.
|
|
620
|
-
* @returns Granted leases.
|
|
621
|
-
*/
|
|
622
516
|
async claim(lagging, leading, by, millis, lane) {
|
|
623
517
|
await sleep();
|
|
624
518
|
const has_work = (s) => s.correlated_at !== void 0 && s.at < s.correlated_at;
|
|
@@ -654,15 +548,6 @@ var InMemoryStore = class {
|
|
|
654
548
|
(p) => this._streams.get(p.stream)?.lease({ ...p, by, retry: 0 }, millis)
|
|
655
549
|
).filter((l) => !!l);
|
|
656
550
|
}
|
|
657
|
-
/**
|
|
658
|
-
* Registers streams for event processing. When the same stream is
|
|
659
|
-
* resubscribed with a different priority, the **maximum** wins — so
|
|
660
|
-
* the highest-priority registered reaction sets the scheduling lane.
|
|
661
|
-
* Use {@link prioritize} for operator runtime overrides.
|
|
662
|
-
*
|
|
663
|
-
* @param streams - Streams to register with optional source + priority.
|
|
664
|
-
* @returns subscribed count and current max watermark.
|
|
665
|
-
*/
|
|
666
551
|
async subscribe(streams, correlated_at, correlator) {
|
|
667
552
|
await sleep();
|
|
668
553
|
let correlating;
|
|
@@ -677,9 +562,7 @@ var InMemoryStore = class {
|
|
|
677
562
|
this._correlators.set(correlator.key, {
|
|
678
563
|
at,
|
|
679
564
|
by: correlator.by,
|
|
680
|
-
//
|
|
681
|
-
// expiry a hair in the future: a successor asking inside the same
|
|
682
|
-
// millisecond would otherwise still be refused.
|
|
565
|
+
// Release outright, or a successor in the same ms is still refused.
|
|
683
566
|
until: correlator.millis > 0 ? now + correlator.millis : 0
|
|
684
567
|
});
|
|
685
568
|
} else {
|
|
@@ -721,53 +604,26 @@ var InMemoryStore = class {
|
|
|
721
604
|
...correlating === void 0 ? {} : { correlating }
|
|
722
605
|
};
|
|
723
606
|
}
|
|
724
|
-
/**
|
|
725
|
-
* Acknowledge completion of processing for leased streams.
|
|
726
|
-
* @param leases - Leases to acknowledge, including last processed watermark and lease holder.
|
|
727
|
-
*/
|
|
728
607
|
async ack(leases) {
|
|
729
608
|
await sleep();
|
|
730
609
|
return leases.map((l) => this._streams.get(l.stream)?.ack(l)).filter((l) => !!l);
|
|
731
610
|
}
|
|
732
|
-
/**
|
|
733
|
-
* Block a stream for processing after failing to process and reaching max retries with blocking enabled.
|
|
734
|
-
* @param leases - Leases to block, including lease holder and last error message.
|
|
735
|
-
* @returns Blocked leases.
|
|
736
|
-
*/
|
|
737
611
|
async block(leases) {
|
|
738
612
|
await sleep();
|
|
739
613
|
return leases.map((l) => this._streams.get(l.stream)?.block(l, l.error)).filter((l) => !!l);
|
|
740
614
|
}
|
|
741
|
-
/**
|
|
742
|
-
* Hold the matched streams out of {@link claim} until `deferred_at`
|
|
743
|
-
* (ms since epoch) — see {@link Store.defer}. Accepts an explicit list
|
|
744
|
-
* of names or a {@link StreamFilter}, mirroring {@link reset}/{@link unblock}.
|
|
745
|
-
* Persisted store state (unlike in-process backoff), so the skip is honored
|
|
746
|
-
* by every competing worker. Unknown names are silently skipped.
|
|
747
|
-
*
|
|
748
|
-
* @returns Count of streams whose `deferred_at` was set.
|
|
749
|
-
*/
|
|
750
615
|
async defer(input, deferred_at) {
|
|
751
616
|
await sleep();
|
|
752
617
|
const selected = this._select(input);
|
|
753
618
|
for (const s of selected) s.defer(deferred_at);
|
|
754
619
|
return selected.length;
|
|
755
620
|
}
|
|
756
|
-
/**
|
|
757
|
-
* The streams named by `input`: an explicit list (de-duplicated, so a
|
|
758
|
-
* repeated name counts once, matching the SQL adapters' set-based
|
|
759
|
-
* `stream = ANY(...)`; unknown names are skipped) or a {@link StreamFilter}.
|
|
760
|
-
*/
|
|
621
|
+
/** De-duplicated like the SQL `stream = ANY(...)`; unknown names skipped. */
|
|
761
622
|
_select(input) {
|
|
762
623
|
if (Array.isArray(input))
|
|
763
624
|
return [...new Set(input)].map((name) => this._streams.get(name)).filter((s) => s !== void 0);
|
|
764
625
|
return [...this._streams.values()].filter(this._filter_predicate(input));
|
|
765
626
|
}
|
|
766
|
-
/**
|
|
767
|
-
* Build a predicate from a {@link StreamFilter}. Compiled regexes are
|
|
768
|
-
* cached in the closure so callers can apply it across the streams
|
|
769
|
-
* map without re-compiling per iteration.
|
|
770
|
-
*/
|
|
771
627
|
_filter_predicate(filter) {
|
|
772
628
|
const stream_re = filter.stream !== void 0 && !filter.stream_exact ? new RegExp(filter.stream) : void 0;
|
|
773
629
|
const source_re = filter.source !== void 0 && !filter.source_exact ? new RegExp(filter.source) : void 0;
|
|
@@ -787,46 +643,18 @@ var InMemoryStore = class {
|
|
|
787
643
|
return true;
|
|
788
644
|
};
|
|
789
645
|
}
|
|
790
|
-
/**
|
|
791
|
-
* Reset watermarks to -1, clearing retry, blocked, error, and lease
|
|
792
|
-
* state so the matched streams can be replayed from the beginning.
|
|
793
|
-
* Accepts either an explicit list of names or a {@link StreamFilter}.
|
|
794
|
-
*
|
|
795
|
-
* @param input - Stream names or a filter selecting the streams to reset.
|
|
796
|
-
* @returns Count of streams that were actually reset.
|
|
797
|
-
*/
|
|
798
646
|
async reset(input) {
|
|
799
647
|
await sleep();
|
|
800
648
|
const selected = this._select(input);
|
|
801
649
|
for (const s of selected) s.reset();
|
|
802
650
|
return selected.length;
|
|
803
651
|
}
|
|
804
|
-
/**
|
|
805
|
-
* Wipe the sensitive-data payload for every event on the stream — see
|
|
806
|
-
* {@link Store.forget_pii}. O(1) drop of the stream's inner Map; the size of
|
|
807
|
-
* that Map is the count of events that had PII. Idempotent: a second call
|
|
808
|
-
* finds no inner Map and returns `0`.
|
|
809
|
-
*
|
|
810
|
-
* @param stream - Target stream.
|
|
811
|
-
* @returns Count of events whose isolated PII payload was deleted.
|
|
812
|
-
*/
|
|
813
652
|
async forget_pii(stream) {
|
|
814
653
|
await sleep();
|
|
815
654
|
const count = this._pii.get(stream)?.size ?? 0;
|
|
816
655
|
this._pii.delete(stream);
|
|
817
656
|
return count;
|
|
818
657
|
}
|
|
819
|
-
/**
|
|
820
|
-
* Clear the blocked flag (and retry / error / lease) on the matched
|
|
821
|
-
* streams without touching the watermark. Streams that aren't blocked
|
|
822
|
-
* at call time are silently skipped. Accepts either an explicit list
|
|
823
|
-
* of names or a {@link StreamFilter}. The filter form always restricts
|
|
824
|
-
* to blocked streams — passing `blocked: false` matches nothing.
|
|
825
|
-
* See {@link Store.unblock}.
|
|
826
|
-
*
|
|
827
|
-
* @param input - Stream names or a filter selecting the streams to unblock.
|
|
828
|
-
* @returns Count of streams that were actually flipped (were blocked).
|
|
829
|
-
*/
|
|
830
658
|
async unblock(input) {
|
|
831
659
|
await sleep();
|
|
832
660
|
const selected = this._select(
|
|
@@ -834,26 +662,12 @@ var InMemoryStore = class {
|
|
|
834
662
|
);
|
|
835
663
|
return selected.filter((s) => s.unblock()).length;
|
|
836
664
|
}
|
|
837
|
-
/**
|
|
838
|
-
* Bulk-update priority of streams matching `filter`. Mirrors
|
|
839
|
-
* {@link query_streams}'s filter semantics — see {@link Store.prioritize}.
|
|
840
|
-
* Unlike {@link subscribe} (which keeps `max()` of registered
|
|
841
|
-
* priorities), this sets the priority outright — operator override
|
|
842
|
-
* for the build-time scheduling policy.
|
|
843
|
-
*
|
|
844
|
-
* @returns Count of streams whose priority changed.
|
|
845
|
-
*/
|
|
846
665
|
async prioritize(filter, priority) {
|
|
847
666
|
await sleep();
|
|
848
667
|
const changed = this._select(filter).filter((s) => s.priority !== priority);
|
|
849
668
|
for (const s of changed) s.set_priority(priority);
|
|
850
669
|
return changed.length;
|
|
851
670
|
}
|
|
852
|
-
/**
|
|
853
|
-
* Streams registered subscription positions to the callback, ordered by
|
|
854
|
-
* stream name. Returns the highest event id in the store and the count
|
|
855
|
-
* of positions emitted.
|
|
856
|
-
*/
|
|
857
671
|
async query_streams(callback, query) {
|
|
858
672
|
await sleep();
|
|
859
673
|
const limit = query?.limit ?? 100;
|
|
@@ -896,19 +710,6 @@ var InMemoryStore = class {
|
|
|
896
710
|
}
|
|
897
711
|
return { maxEventId: this._events.at(-1)?.id ?? -1, count };
|
|
898
712
|
}
|
|
899
|
-
/**
|
|
900
|
-
* Per-stream aggregated stats — see {@link Store.query_stats}.
|
|
901
|
-
*
|
|
902
|
-
* Single forward scan over the in-memory event list, accumulating per
|
|
903
|
-
* stream. The "cheap heads" cost tier from durable adapters doesn't
|
|
904
|
-
* apply here (InMemory has no indexes); correctness is the goal, perf
|
|
905
|
-
* is a non-issue.
|
|
906
|
-
*
|
|
907
|
-
* Scope rules:
|
|
908
|
-
* - Array `input` — explicit stream names, regardless of subscription.
|
|
909
|
-
* - Filter `input` — `stream`/`stream_exact` match against event-bearing
|
|
910
|
-
* stream names. Empty filter `{}` matches every event-bearing stream.
|
|
911
|
-
*/
|
|
912
713
|
async query_stats(input, options) {
|
|
913
714
|
await sleep();
|
|
914
715
|
const exclude = new Set(options?.exclude ?? []);
|
|
@@ -970,15 +771,6 @@ var InMemoryStore = class {
|
|
|
970
771
|
}
|
|
971
772
|
return out;
|
|
972
773
|
}
|
|
973
|
-
/**
|
|
974
|
-
* Atomically truncates streams and seeds each with a snapshot or tombstone.
|
|
975
|
-
* Windowed targets (`before` set) prune the prefix below the closest safe
|
|
976
|
-
* `__snapshot__` instead — no seed, subscriptions untouched, no-op when no
|
|
977
|
-
* snapshot qualifies.
|
|
978
|
-
* @param targets - Streams to truncate with optional snapshot state and meta,
|
|
979
|
-
* or a `before`/`max_id` boundary for a windowed prefix delete.
|
|
980
|
-
* @returns Map keyed by stream name, each entry with `deleted` count and `committed` event.
|
|
981
|
-
*/
|
|
982
774
|
async truncate(targets) {
|
|
983
775
|
await sleep();
|
|
984
776
|
const result = /* @__PURE__ */ new Map();
|
|
@@ -1029,18 +821,7 @@ var InMemoryStore = class {
|
|
|
1029
821
|
}
|
|
1030
822
|
return result;
|
|
1031
823
|
}
|
|
1032
|
-
/**
|
|
1033
|
-
* Atomically wipe-and-rebuild the store under an in-process snapshot.
|
|
1034
|
-
*
|
|
1035
|
-
* Captures every index state up front, clears it, then hands the
|
|
1036
|
-
* orchestrator a per-event insert `callback` via the driver. Any
|
|
1037
|
-
* throw inside the driver restores the snapshot, leaving the store
|
|
1038
|
-
* byte-for-byte unchanged from the operator's perspective.
|
|
1039
|
-
*
|
|
1040
|
-
* `id`s are reassigned `0..N-1` as events arrive (dense — the
|
|
1041
|
-
* monotonic id counter restarts at 0 for the rebuild). `created` is
|
|
1042
|
-
* preserved verbatim from the source.
|
|
1043
|
-
*/
|
|
824
|
+
/** A throw inside the driver restores the captured state. Ids restart at 0. */
|
|
1044
825
|
async restore(driver) {
|
|
1045
826
|
await sleep();
|
|
1046
827
|
const prev_events = this._events;
|
|
@@ -1289,4 +1070,4 @@ export {
|
|
|
1289
1070
|
TOMBSTONE_EVENT,
|
|
1290
1071
|
DEFAULT_LANE
|
|
1291
1072
|
};
|
|
1292
|
-
//# sourceMappingURL=chunk-
|
|
1073
|
+
//# sourceMappingURL=chunk-QXW3JV2H.js.map
|