MCPcopy Create free account
hub / github.com/Openpanel-dev/openpanel / worker

Method worker

packages/db/src/buffers/base-buffer.ts:232–240  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

230 const results = new Array<R>(items.length);
231 let nextIndex = 0;
232 const worker = async (): Promise<void> => {
233 while (true) {
234 const idx = nextIndex++;
235 if (idx >= items.length) {
236 return;
237 }
238 results[idx] = await fn(items[idx] as T, idx);
239 }
240 };
241 const workers = Array.from(
242 { length: Math.min(concurrency, items.length) },
243 () => worker()

Callers

nothing calls this directly

Calls 1

fnFunction · 0.85

Tested by

no test coverage detected