Repository navigation
Singular function names, and one name each for the engines' limits - #98
Merged
Merged
Conversation
Two of the batch's own closures called Complete-PkProcess and Write-PkMessage by name. A .GetNewClosure() block only sees global functions, so a batch failed with "'Complete-PkProcess' is not recognized" when the kit was loaded for one module only. They're captured up front now, like the private helpers. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A worker given the function (-SharedFunctionNames takes it) could set a handler made in its own runspace, which the main thread then ran for every message. Running another runspace's scriptblock can hang or crash PowerShell. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
It only looked for an abort after its first 200 ms wait, so a program that finished sooner ran to the end and returned normally, and a slower one ran for about 200 ms before it was killed. It now throws before starting the program, unless -IgnoreAbort is given. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… GetNewClosure
DelegateCast missed a scriptblock passed to .NET as ({ 1 }), { 1 }.GetNewClosure(),
[scriptblock]{ 1 } and the like, in the call or through a variable.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Invoke-PkRunspaceJobs is Invoke-PkRunspaceBatch, and 13 private functions lose their plural names. -MaxConcurrent and -AbortTimeoutSeconds are the only names on every engine: -MaxParallel and -DrainTimeoutSeconds are gone. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts: # README.md
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.
Renames for the next major version, while few scripts depend on the old names. PowerShell nouns are singular, and the engines had two names for the same two settings.
Breaking
Invoke-PkRunspaceJobsisInvoke-PkRunspaceBatch, to matchInvoke-PkProcessBatch.-MaxConcurrentand-AbortTimeoutSecondsare the only names, on every engine.-MaxParalleland-DrainTimeoutSecondswereInvoke-PkRunspaceJobs' own names, and aliases on the other two engines; they're gone, and so are the aliases the other way round.Internal only
Receive-PkWorkerMessage,Resolve-PkArgumentList,Split-PkTaskkillArgumentList,Stop-PkJobProcess,Get-PkJobOutputLimit(wasGet-PkJobMaxOutputChars),Wait-PkRunningJob,Add-PkDispatchGroupJob,Get-PkWorkerSafeFunctionName,Add-PkJobError,Receive-PkCompletedHandle,Get-PkPredefinedVariable,Get-PkCommandVariable,Get-PkUndeclaredVariable.The README, the help and the scripts under
Testing/use the new names. The README's "Not planned" entry on renames now covers only aliases for result fields.Tests
-MaxConcurrentand-AbortTimeoutSecondswith no aliases,-MaxParallelis an error, andInvoke-PkRunspaceJobsis gone. The test that an unknown argument toInitialize-ParallelKitis refused used-MaxParallel; it uses-AbortTimeoutSecondsnow.PSUseSingularNounsreports nothing (14 before).Testing/readme-examples/run.ps1passes on both.🤖 Generated with Claude Code