@absolutejs/absolute 0.20.0-beta.75 → 0.20.0-beta.77

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.
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  var __require = import.meta.require;
3
3
 
4
- // .angular-partial-tmp-VFsKxT/src/core/streamingSlotRegistrar.ts
4
+ // .angular-partial-tmp-1yRSOm/src/core/streamingSlotRegistrar.ts
5
5
  var STREAMING_SLOT_REGISTRAR_KEY = Symbol.for("absolutejs.streamingSlotRegistrar");
6
6
  var STREAMING_SLOT_WARNING_STORAGE_KEY = Symbol.for("absolutejs.streamingSlotWarningController");
7
7
  var STREAMING_SLOT_COLLECTION_STORAGE_KEY = Symbol.for("absolutejs.streamingSlotCollectionController");
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  var __require = import.meta.require;
3
3
 
4
- // .angular-partial-tmp-VFsKxT/src/core/streamingSlotRegistrar.ts
4
+ // .angular-partial-tmp-1yRSOm/src/core/streamingSlotRegistrar.ts
5
5
  var STREAMING_SLOT_REGISTRAR_KEY = Symbol.for("absolutejs.streamingSlotRegistrar");
6
6
  var STREAMING_SLOT_WARNING_STORAGE_KEY = Symbol.for("absolutejs.streamingSlotWarningController");
7
7
  var STREAMING_SLOT_COLLECTION_STORAGE_KEY = Symbol.for("absolutejs.streamingSlotCollectionController");
@@ -48,7 +48,7 @@ var warnMissingStreamingSlotCollector = (primitiveName) => {
48
48
  getWarningController()?.maybeWarn(primitiveName);
49
49
  };
50
50
 
51
- // .angular-partial-tmp-VFsKxT/src/core/streamingSlotRegistry.ts
51
+ // .angular-partial-tmp-1yRSOm/src/core/streamingSlotRegistry.ts
52
52
  var STREAMING_SLOT_STORAGE_KEY = Symbol.for("absolutejs.streamingSlotAsyncLocalStorage");
53
53
  var isObjectRecord2 = (value) => Boolean(value) && typeof value === "object";
54
54
  var isAsyncLocalStorage = (value) => isObjectRecord2(value) && ("getStore" in value) && typeof value.getStore === "function" && ("run" in value) && typeof value.run === "function";
package/dist/build.js CHANGED
@@ -27581,16 +27581,30 @@ var DEFAULT_BATCH_SIZE = 12, DEFAULT_POLL_MS = 25, DEFAULT_MAX_PAUSE_MS = 2000,
27581
27581
  waited += pollMs;
27582
27582
  }
27583
27583
  };
27584
+ const launchBatch = async (pending) => {
27585
+ const launched = [];
27586
+ while (pending.length > 0 && !cancelled) {
27587
+ if (launched.length > 0 && options.isBusy())
27588
+ break;
27589
+ const task = pending.shift();
27590
+ if (task === undefined)
27591
+ break;
27592
+ launched.push(Promise.resolve(task()));
27593
+ await sleep2(0);
27594
+ }
27595
+ await Promise.all(launched);
27596
+ return launched.length;
27597
+ };
27584
27598
  const run = async () => {
27585
27599
  let completed = 0;
27586
27600
  const iterator = tasks[Symbol.iterator]();
27601
+ let pending = [];
27587
27602
  while (!cancelled) {
27588
27603
  await waitForIdle();
27589
- const batch = cancelled ? [] : takeBatch(iterator, batchSize);
27590
- if (batch.length === 0)
27604
+ pending = pending.length === 0 && !cancelled ? takeBatch(iterator, batchSize) : pending;
27605
+ if (pending.length === 0)
27591
27606
  break;
27592
- await Promise.all(batch.map((task) => task()));
27593
- completed += batch.length;
27607
+ completed += await launchBatch(pending);
27594
27608
  await sleep2(0);
27595
27609
  }
27596
27610
  return completed;
@@ -35963,5 +35977,5 @@ export {
35963
35977
  devBuild
35964
35978
  };
35965
35979
 
35966
- //# debugId=7CD9B9A5E2C68CE964756E2164756E21
35980
+ //# debugId=1AE50D17EEF6199A64756E2164756E21
35967
35981
  //# sourceMappingURL=build.js.map