forked from olcxjas-softworks/LarpixClient
update electron to v43
This commit is contained in:
parent
68ac0beedf
commit
fb6c8b6ee9
5385 changed files with 513060 additions and 123058 deletions
17
electron/node_modules/tiny-async-pool/lib/es7.js
generated
vendored
Normal file
17
electron/node_modules/tiny-async-pool/lib/es7.js
generated
vendored
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
async function asyncPool(poolLimit, iterable, iteratorFn) {
|
||||
const ret = [];
|
||||
const executing = new Set();
|
||||
for (const item of iterable) {
|
||||
const p = Promise.resolve().then(() => iteratorFn(item, iterable));
|
||||
ret.push(p);
|
||||
executing.add(p);
|
||||
const clean = () => executing.delete(p);
|
||||
p.then(clean).catch(clean);
|
||||
if (executing.size >= poolLimit) {
|
||||
await Promise.race(executing);
|
||||
}
|
||||
}
|
||||
return Promise.all(ret);
|
||||
}
|
||||
|
||||
module.exports = asyncPool;
|
||||
Loading…
Add table
Add a link
Reference in a new issue