@rotorsoft/act 1.18.2 → 1.18.4

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.js CHANGED
@@ -19,7 +19,7 @@ import {
19
19
  sleep,
20
20
  store,
21
21
  validate
22
- } from "./chunk-KL37CDMW.js";
22
+ } from "./chunk-TODGOWEZ.js";
23
23
  import {
24
24
  ActorSchema,
25
25
  CausationEventSchema,
@@ -45,7 +45,6 @@ import {
45
45
  pii_strip,
46
46
  sensitive
47
47
  } from "./chunk-2RZSKBZZ.js";
48
- import "./chunk-YLJ4XMA6.js";
49
48
 
50
49
  // src/signals.ts
51
50
  process.once("SIGINT", async (arg) => {
@@ -1467,7 +1466,6 @@ async function fetch(leased, eventLimit) {
1467
1466
  }
1468
1467
  var ack = (leases) => store().ack(leases);
1469
1468
  var block = (leases) => store().block(leases);
1470
- var defer = (input, deferred_at) => store().defer(input, deferred_at);
1471
1469
  var subscribe = (streams) => store().subscribe(streams);
1472
1470
 
1473
1471
  // src/internal/event-sourcing.ts
@@ -1948,7 +1946,6 @@ function build_drain(logger) {
1948
1946
  fetch,
1949
1947
  ack,
1950
1948
  block,
1951
- defer,
1952
1949
  subscribe: logger.level !== "trace" ? subscribe : traced(subscribe, (result, streams) => {
1953
1950
  if (!result.subscribed) return;
1954
1951
  const lanes = new Set(streams.map((s) => s.lane ?? "default"));
@@ -2052,21 +2049,13 @@ async function run_drain_cycle(ops, registry, batch_handlers, handle, handle_bat
2052
2049
  })
2053
2050
  );
2054
2051
  const acked = await ops.ack(
2055
- handled.filter((h) => h.defer === void 0 && (h.handled > 0 || !h.error)).map((h) => ({ ...h.lease, at: h.acked_at }))
2052
+ handled.flatMap(
2053
+ (h) => h.defer !== void 0 ? { ...h.lease, due: h.defer } : h.handled > 0 || !h.error ? { ...h.lease, at: h.acked_at } : []
2054
+ )
2056
2055
  );
2057
2056
  const blocked = await ops.block(
2058
2057
  handled.filter(({ block: block2 }) => block2).map(({ lease, error }) => ({ ...lease, error }))
2059
2058
  );
2060
- const deferrals = handled.filter((h) => h.defer !== void 0);
2061
- if (deferrals.length) {
2062
- const by_time = /* @__PURE__ */ new Map();
2063
- for (const h of deferrals) {
2064
- const list = by_time.get(h.defer);
2065
- if (list) list.push(h.lease.stream);
2066
- else by_time.set(h.defer, [h.lease.stream]);
2067
- }
2068
- for (const [at, streams] of by_time) await ops.defer(streams, at);
2069
- }
2070
2059
  const closeable = handled.filter((h) => h.close !== void 0).map((h) => h.close);
2071
2060
  return { leased, fetched, handled, acked, blocked, closeable };
2072
2061
  }