-
-
Notifications
You must be signed in to change notification settings - Fork 8
feat: Allow max concurrency for parallel map with option #15
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
Conversation
|
Huh. I am unsure what I am doing that would only fail on node 0.10... Is there some old v8 bug I'm triggering? |
|
@weswigham I think it's useful to support max concurrency in here but I don't want to use an environment variable. Can you change the PR to pass in |
|
@phated should the option be a member of the |
|
@weswigham yes, I think we can include it in the extensions object and then I will rename them in the docs. |
Makes `map` aware of a `NAL_MAX_CONCURRENCY` environment variable which, when set to a positive integer, controls the maximum number of concurrent iterations which may be in-flight at once.
phated
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR seemed to have stalled, so I updated it with my desired API, changed extensions to options throughout, added tests and docs.
I also rebased this on the new project template updates.
If everything is green, I'll get this merged 🎉 Thanks for sending over the proposal @weswigham
Makes
mapaware of aNAL_MAX_CONCURRENCYenvironment variable which, when set to a positive integer, controls the maximum number of concurrent iterations which may be in-flight at once.My usecase here is that I'd like to see a deterministic build log output order from a build I don't really control, which is run with either
gulporjust(both of which useundertaker, which usesbachwhich uses this for itsparallelmode). To do so, I'd like to set the maximum allowable concurrency to1concurrent operation at a time, this way the output log order isn't affected by the runtime of various operations.lernaandrushboth allow doing this at the monorepo level, however there's no way to do it down at the individual task-runner level yet.If this would be a welcome change to
now-and-later, I can add some tests and documentation, or, if you think a "no concurrency" type feature would be better served inundertakeritself, I could look there, too (although at any layer above this you pretty much just get a yes/no, not a configurable maximum count, unless you amendnow-and-later's API to take an optional concurrency limit parameter).