Repository navigation
Reject unknown arguments everywhere; accept each engine's limit names on all - #35
Merged
Merged
Conversation
… on all Seven public functions weren't advanced functions, so a wrong or extra argument was silently ignored: Initialize-ParallelKit -MaxParallel 300 left the thread pool unsized, and Reset-PkAbortState -WhatIf reset anyway. They now have [CmdletBinding()]. The batch checks -MaxConcurrent itself, so its error names the batch rather than Invoke-PkProcessDispatch. The process engines take -MaxParallel and -DrainTimeoutSeconds, and the runspace engine takes -MaxConcurrent and -AbortTimeoutSeconds, as aliases. Get-Help doesn't show aliases, so the help text and README name them. On Invoke-PkRunspaceJobs, -Abort no longer abbreviates -AbortWaitMessage, since it now also matches the -AbortTimeoutSeconds alias. -CheckWorkerSafety is a plain switch: not passing it means on, as before, and a bare -CheckWorkerSafety or -CheckWorkerSafety:$false behaves as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
What was wrong
Initialize-ParallelKit,Set-PkMessageHandler,Request-PkAbort,Test-PkAbortSignal,Test-PkCancelRequested,Get-PkAbortTriggerLabel,Reset-PkAbortState) weren't advanced functions, so a wrong or extra argument was silently ignored.Initialize-ParallelKit -MaxParallel 300left the thread pool unsized, andReset-PkAbortState -WhatIfreset anyway.Invoke-PkProcessBatch -MaxConcurrent 0failed with an error namingInvoke-PkProcessDispatch.-MaxConcurrent/-AbortTimeoutSecondsand the runspace engine says-MaxParallel/-DrainTimeoutSecondsfor the same things, so using one engine's name on the other was an error.-CheckWorkerSafetywas a switch defaulting to$true, which lint tools flag.What changed
[CmdletBinding()]on those seven, so unknown arguments are an error. Every public function is now advanced, and the harness checks that.-MaxConcurrentitself.-MaxParalleland-DrainTimeoutSecondson the batch and dispatcher,-MaxConcurrentand-AbortTimeoutSecondsonInvoke-PkRunspaceJobs.Get-Helpdoesn't show aliases, so the help text and README name them.-CheckWorkerSafetyis a plain switch. Not passing it still means on; a bare-CheckWorkerSafetyand-CheckWorkerSafety:$falsebehave as before, and a splattedCheckWorkerSafety = $falseis tested too.Behavior to note
Invoke-PkRunspaceJobs, the abbreviation-Abortused to mean-AbortWaitMessage. It now also matches the-AbortTimeoutSecondsalias, so it fails with "parameter name 'Abort' is ambiguous" before anything starts. Spell out-AbortWaitMessage.Testing
Harness passes on Windows PowerShell 5.1 and PowerShell 7 (378 assertions, none skipped). 8 of the new assertions failed before the change.
🤖 Generated with Claude Code