@rotorsoft/act 1.27.0 → 1.29.0

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.
@@ -373,10 +373,6 @@ var extend = (source, schema, target) => {
373
373
  async function sleep(ms) {
374
374
  return new Promise((resolve) => setTimeout(resolve, ms ?? config().sleepMs));
375
375
  }
376
- var SOURCE_METACHARACTERS = /[\^$.*+?()[\]{}|\\]/;
377
- function is_literal_source(source) {
378
- return !SOURCE_METACHARACTERS.test(source);
379
- }
380
376
 
381
377
  // src/config.ts
382
378
  var PackageSchema = import_zod4.z.object({
@@ -870,19 +866,7 @@ var InMemoryStore = class {
870
866
  */
871
867
  async claim(lagging, leading, by, millis, lane) {
872
868
  await sleep();
873
- const has_work = (s) => {
874
- if (s.correlated_at !== void 0) return s.at < s.correlated_at;
875
- if (!s.source) return s.at < this._max_non_snap_event_id;
876
- if (is_literal_source(s.source)) {
877
- const max_id = this._max_event_id_by_stream.get(s.source);
878
- return max_id !== void 0 && max_id > s.at;
879
- }
880
- const re = new RegExp(s.source);
881
- for (const [stream_name, max_id] of this._max_event_id_by_stream) {
882
- if (max_id > s.at && re.test(stream_name)) return true;
883
- }
884
- return false;
885
- };
869
+ const has_work = (s) => s.correlated_at !== void 0 && s.at < s.correlated_at;
886
870
  const available = [...this._streams.values()].filter(
887
871
  (s) => s.is_available && has_work(s) && (lane === void 0 || s.lane === lane)
888
872
  );
@@ -1171,7 +1155,8 @@ var InMemoryStore = class {
1171
1155
  leased_by: s.leased_by,
1172
1156
  leased_until: s.leased_until,
1173
1157
  lane: s.lane,
1174
- deferred_at: s.deferred_at
1158
+ deferred_at: s.deferred_at,
1159
+ correlated_at: s.correlated_at
1175
1160
  });
1176
1161
  count++;
1177
1162
  if (count >= limit) break;