-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Add maxWorkers option #2655
Add maxWorkers option #2655
Conversation
cc @lucaswoj I don't see an especially good way to add meaningful tests for this, since it's basically about passing a number through to |
Looks like you made one test start failing. That might be a good place to start looking. 😉 |
@@ -58,7 +58,8 @@ | |||
zoom: 12.5, | |||
center: [-77.01866, 38.888], | |||
style: 'mapbox://styles/mapbox/streets-v8', | |||
hash: true | |||
hash: true, | |||
maxWorkers: 3 |
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.
Why max
Workers
? Isn't this literally the number of workers?
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.
👍 numWorkers
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.
@lucaswoj @mourner I considered "num", but chose "max" -- this was the argument in my head:
maxWorkers
is really what the user (me) wants to control, whereas numWorkers
is more of an internal property. The fact that they are the same right now is an implementation detail; I could imagine the implementation changing to, say, construct/destroy workers on demand (especially given the possibility of worker pooling).
That said, I don't feel especially strongly about this, so just lemme know what yall think
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.
Right now, this property literally controls the number of spawned workers. If we change the implementation in the future, we can change the property name 😄
Let's go with workerCount
for an abbreviation-free, grammatically correct, and best-practice compliant name.
Happy to 🚢 this with a test case, and agreenment on the parameter name. |
Oh dear. 😊 Thanks, will do. |
0a494c2
to
886dfa9
Compare
@lucaswoj Fixed the failing test and added another, but the build still fails because coveralls (I think) doesn't like my fork:
|
The coveralls error should have been (might have been?) fixed by 1b25043. Have you rebased in the last day? |
886dfa9
to
c534c2e
Compare
I had not! Just rebased and force pushed. |
Rad! Looks like it is working now. |
Sweet! Did you see my note about the option name? Easy to change, just lemme know. |
Also sets maxWorkers on the debug page to 3, on the theory that a pretty large majority of users have 4 cpus. Closes mapbox#2022
c534c2e
to
fefd395
Compare
Amended the commit:
I believe this should now be ready |
➡️ #2666 |
Also sets maxWorkers on the debug page to 3, on the theory that a pretty
large majority of users have 4 cpus.
Closes #2022