MCPcopy Create free account
hub / github.com/MigoXLab/coderio / processTask

Function processTask

src/utils/promise-pool.ts:17–25  ·  view source on GitHub ↗
(index: number)

Source from the content-addressed store, hash-verified

15 const executing = new Set<Promise<void>>();
16
17 const processTask = async (index: number) => {
18 const item = items[index];
19 if (!item) {
20 results[index] = undefined as unknown as R;
21 return;
22 }
23 const result = await taskGenerator(item);
24 results[index] = result;
25 };
26
27 while (nextIndex < items.length || executing.size > 0) {
28 while (nextIndex < items.length && executing.size < concurrency) {

Callers 1

promisePoolFunction · 0.85

Calls 1

taskGeneratorFunction · 0.85

Tested by

no test coverage detected