Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include the queue index number in which the async callback function in parallel is called #288

Open
UnKnoWn-Consortium opened this issue Apr 10, 2023 · 0 comments · May be fixed by #289
Open
Labels
enhancement New feature or request

Comments

@UnKnoWn-Consortium
Copy link
Contributor

UnKnoWn-Consortium commented Apr 10, 2023

Sorry for the rather convoluted title... Basically it is that the async function will be called not just with the item value but also an index number for the queue in parallel. It may be helpful for building UIs, e.g. progress bars.

E.g.:

const users = await parallel(3, userIds, async (userId, index) => {
  return await api.users.find(userId)
})
@UnKnoWn-Consortium UnKnoWn-Consortium changed the title Include the queue index number in which the async function in parallel is called in the async function Include the queue index number in which the async callback function in parallel is called in the async function Apr 10, 2023
@UnKnoWn-Consortium UnKnoWn-Consortium changed the title Include the queue index number in which the async callback function in parallel is called in the async function Include the queue index number in which the async callback function in parallel is called Apr 10, 2023
@sodiray sodiray added the enhancement New feature or request label Jun 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
2 participants