@rotorsoft/act 1.22.2 → 1.22.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.
@@ -649,7 +649,7 @@ var InMemoryStore = class {
649
649
  _streams = /* @__PURE__ */ new Map();
650
650
  // last committed version per stream — O(1) replacement for filter-on-commit
651
651
  _stream_versions = /* @__PURE__ */ new Map();
652
- // max non-snapshot event id per stream — drives the source-pattern probe in claim()
652
+ // max non-snapshot event id per stream — drives the exact-source probe in claim()
653
653
  // without scanning the full event log.
654
654
  _max_event_id_by_stream = /* @__PURE__ */ new Map();
655
655
  // global max non-snapshot event id — fast pre-check for source-less streams in claim()
@@ -837,23 +837,11 @@ var InMemoryStore = class {
837
837
  */
838
838
  async claim(lagging, leading, by, millis, lane) {
839
839
  await sleep();
840
- const source_regex = /* @__PURE__ */ new Map();
841
- const get_regex = (source) => {
842
- let re = source_regex.get(source);
843
- if (!re) {
844
- re = new RegExp(source);
845
- source_regex.set(source, re);
846
- }
847
- return re;
848
- };
849
840
  const has_work = (s) => {
850
841
  if (s.at < 0) return true;
851
842
  if (!s.source) return s.at < this._max_non_snap_event_id;
852
- const re = get_regex(s.source);
853
- for (const [stream_name, maxId] of this._max_event_id_by_stream) {
854
- if (maxId > s.at && re.test(stream_name)) return true;
855
- }
856
- return false;
843
+ const max_id = this._max_event_id_by_stream.get(s.source);
844
+ return max_id !== void 0 && max_id > s.at;
857
845
  };
858
846
  const available = [...this._streams.values()].filter(
859
847
  (s) => s.is_available && has_work(s) && (lane === void 0 || s.lane === lane)