You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Just a suggestion - in the readme gotchas section it says:
limiter.schedule(() => {
const allTasks = tasksArray.map(x => processTask(x));
// GOOD, we wait until all tasks are done.
return Promise.all(allTasks);
});
When I initially read this I read this as meaning you could wrap .schedule around a Promise.all and it would throttle the requests within the Promise.all, which upon further reading and testing isn't the case and I ended up with the following as part of a larger function.
The use of allSettled isn't relevant in this instance however the use of "// GOOD, we wait until all tasks are done." in the gotcha documentation gave me the impression that the async calls should all be wrapped by the .schedule function.
The documentation overall is very clear, just this example in particular I feel could be a little clearer.
The text was updated successfully, but these errors were encountered:
Just a suggestion - in the readme gotchas section it says:
When I initially read this I read this as meaning you could wrap .schedule around a Promise.all and it would throttle the requests within the Promise.all, which upon further reading and testing isn't the case and I ended up with the following as part of a larger function.
The use of allSettled isn't relevant in this instance however the use of "// GOOD, we wait until all tasks are done." in the gotcha documentation gave me the impression that the async calls should all be wrapped by the .schedule function.
The documentation overall is very clear, just this example in particular I feel could be a little clearer.
The text was updated successfully, but these errors were encountered: