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

feat(parallel): limit handle with infinity, zero and negative numbers #238

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

MarlonPassos-git
Copy link
Contributor

@MarlonPassos-git MarlonPassos-git commented Sep 8, 2024

Tip

The owner of this PR can publish a preview release by commenting /publish in this PR. Afterwards, anyone can try it out by running pnpm add radashi@pr<PR_NUMBER>.

Summary

now:

const array = [1, 2, 3]
const doSomething = async (n: number) => { ...}
_.parallel(-1, array, doSomething) // run 1 function in paraller (in the current implementation no function is executed)
_.parallel(0, array, doSomething) // run 1 function in paraller (in the current implementation no function is executed)
_.parallel(100, array, doSomething) // run 3 function in paraller 
_.parallel(Infinity, array, doSomething) // run 3 function in paraller (in the current implementation this throws an error)

Related issue, if any:

https://github.com/orgs/radashi-org/discussions/235
sodiray/radash#426

For any code change,

  • Related documentation has been updated, if needed
  • Related tests have been added or updated, if needed
  • Related benchmarks have been added or updated, if needed

Does this PR introduce a breaking change?

No

Bundle impact

Status File Size 1 Difference
M src/async/parallel.ts 1407 +135 (+11%)

Footnotes

  1. Function size includes the import dependencies of the function.

@MarlonPassos-git MarlonPassos-git changed the title feat(parallel): limit handle with infinity and negative numbers feat(parallel): limit handle with infinity, zero and negative numbers Sep 8, 2024
@aleclarson aleclarson added the new feature This PR adds a new function or extends an existing one label Sep 21, 2024
@aleclarson aleclarson added this to the v12.3.0 milestone Sep 21, 2024
@aleclarson
Copy link
Member

Hey! There's a new requirement for PRs that introduce new features. Without this requirement met, we won't be able to merge this. Note that this PR can still be included in a beta prerelease before this requirement is fulfilled.

⚠️ Note: You need to run git rebase main before this file will appear locally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new feature This PR adds a new function or extends an existing one
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants