MCPcopy Create free account
hub / github.com/adobe/react-spectrum / pool

Function pool

scripts/verdaccio-seed.js:100–111  ·  view source on GitHub ↗
(items, worker, size)

Source from the content-addressed store, hash-verified

98}
99
100async function pool(items, worker, size) {
101 const results = [];
102 let index = 0;
103 async function run() {
104 while (index < items.length) {
105 const i = index++;
106 results[i] = await worker(items[i]);
107 }
108 }
109 await Promise.all(Array.from({length: Math.min(size, items.length)}, run));
110 return results;
111}
112
113async function main() {
114 const storagePath = path.resolve(

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected