@rotorsoft/act 1.28.1 → 1.29.1
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 +9 -0
- package/dist/@types/act.d.ts.map +1 -1
- package/dist/@types/adapters/in-memory-store.d.ts.map +1 -1
- package/dist/@types/internal/correlate-cycle.d.ts +20 -0
- package/dist/@types/internal/correlate-cycle.d.ts.map +1 -1
- package/dist/@types/internal/settle.d.ts +1 -0
- package/dist/@types/internal/settle.d.ts.map +1 -1
- package/dist/{chunk-7WFKIQKY.js → chunk-PX3IBVLW.js} +2 -14
- package/dist/chunk-PX3IBVLW.js.map +1 -0
- package/dist/index.cjs +71 -30
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +71 -18
- package/dist/index.js.map +1 -1
- package/dist/test/index.cjs +1 -17
- package/dist/test/index.cjs.map +1 -1
- package/dist/test/index.js +1 -1
- package/package.json +4 -4
- package/dist/chunk-7WFKIQKY.js.map +0 -1
package/dist/test/index.cjs
CHANGED
|
@@ -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
|
);
|