🦜
peace tranquility mind flowers
undefined
- Brasil, Belo Horizonte, Minas Gerais
-
23:26
(UTC -03:00) - in/breno-aps
- https://open.spotify.com/user/12166475058
Highlights
- Pro
Block or Report
Block or report BrenoAlberto
Report abuse
Contact GitHub support about this user’s behavior. Learn more about reporting abuse.
Report abusePinned Loading
-
-
-
It takes an array of functions that ...
It takes an array of functions that return promises (asyncFunctions) and the maximum number of functions to be executed concurrently (maxConcurrent). The function will execute up to maxConcurrent functions in parallel, and once a function completes, it will start a new one until all functions have completed. The function returns a promise that resolves with an array of results in the same order as the input functions. This method provides an efficient way to execute multiple async tasks concurrently while limiting the number of tasks running at any given time. 1export async function concurrentTaskQueue<T>(asyncFunctions: Array<() => Promise<T>>, maxConcurrent: number): Promise<T[]> {
2let currentIndex = 0;
3const runningFunctions = new Set<Promise<T>>();
4const orderedRunnedFunctions: Map<Promise<T>, number> = new Map();
5let results: Array<T> = Array(asyncFunctions.length);
-
-
-
Something went wrong, please refresh the page to try again.
If the problem persists, check the GitHub status page or contact support.
If the problem persists, check the GitHub status page or contact support.