您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Parallel processing module for JavaScript that can specify the number of concurrent executions.
此脚本不应直接安装。它是供其他脚本使用的外部库,要使用该库请加入元指令 // @require https://update.gf.qytechs.cn/scripts/398566/785036/concurrent_promise.js
Parallel processing module for JavaScript that can specify the number of concurrent executions.
let result_info = await concurrent_promise.execute(
promise_function_array, // Array of functions that return Promise (Note: it's not Promise itself)
max_concurrent_worker // Max concurrent Promise number (default: 10)
);
// result_info = {
// promise_results : <Array of results for each Promise>,
// success_list : <Array of successful Promise results>,
// failure_list : <Array of failed Promise results>,
// }
Open the test page in your browser and follow the instructions to run it.
$ cd js-concurrent_promise
$ yarn install
$ node -i
// [load modules]
const { concurrentPromise, concurrent_promise, test } = require( './test/node_test.js' );
// [run]
// test.run( target_module, promise_number, max_concurrent_worker );
// target_module = concurrentPromise: simple version (run Promise.all with each max_concurrent_worker)
test.run( concurrentPromise, 100, 10 );
// target_module = concurrent_promise: efficiency improvement version
test.run( concurrent_promise, 100, 10 );
// [cancel]
test.cancel();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址