Repository navigation
feat: require NonZeroUsize parallelism limits - #5
Merged
Merged
Conversation
smklein
reviewed
Nov 30, 2026
Comment on lines
+288
to
+296
| /// Returns the number of tasks currently in this set. | ||
| pub fn len(&self) -> usize { | ||
| self.set.len() | ||
| } | ||
|
|
||
| /// Returns `true` if this set is currently empty. | ||
| pub fn is_empty(&self) -> bool { | ||
| self.set.is_empty() | ||
| } |
There was a problem hiding this comment.
mmm looks like this might have bled out of #6, which appears to be empty?
smklein
approved these changes
Nov 30, 2026
stacked auto-merge was automatically disabled
November 30, 2026 23:21
Auto-merge was disabled for another pull request in the stack
If the parallelism limit is set to 0, then all calls to `ParallelTaskSet::spawn` will just hang forever. There is basically no situation in which anyone would want that, so we should probably not let you do it. This commit changes the parallelism limit to be a `NonZeroUsize`, which stops you from doing that at the cost of making it slightly more annoying to construct. Fixes #2
hawkw
enabled stacked auto-merge (squash)
November 30, 2026 23:50
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
If the parallelism limit is set to 0, then all calls to
ParallelTaskSet::spawnwill just hang forever. There is basically no situation in which anyone would want that, so we should probably not let you do it.This commit changes the parallelism limit to be a
NonZeroUsize, which stops you from doing that at the cost of making it slightly more annoying to construct.Fixes #2