Wraps an async function to limit the number of concurrent executions.
This function creates a wrapper around an async callback that ensures at most
concurrency number of executions can run simultaneously. Additional calls will
wait until a slot becomes available.
Wraps an async function to limit the number of concurrent executions.
This function creates a wrapper around an async callback that ensures at most
concurrencynumber of executions can run simultaneously. Additional calls will wait until a slot becomes available.将异步函数包装起来以限制并发执行的数量。
此函数创建一个异步回调的包装器,确保最多只有
concurrency个执行可以同时运行。 额外的调用将等待直到有可用的执行槽位。