Releases: ZelAnton/ProcessKit
Releases · ZelAnton/ProcessKit
v1.3.2
Fixed
GetFullOutputAsyncnow captures stdout/stderr faithfully — exact line endings and any trailing newline are preserved instead of being normalized to the host newline and truncated.GetBytesOutputAsync's capturedStdErris likewise faithful. (ToResultAsync, which reads the line-oriented handle, remains line-normalized — its XML doc now says so and points to the faithful helpers.)
v1.3.1
Added
ProcessGroupOptions(ShutdownTimeout,EscalateToKill) and aProcessGroup(ProcessGroupOptions)constructor to tune the UnixSIGTERMgrace window and force-kill escalation. Ignored on Windows, where the Job Object terminates members atomically.ProcessRunOptions.ProcessGroupOptions(configures the private group the runner creates) andProcessRunOptions.PumpTeardownTimeout(bounds how long handle disposal waits for the output pumps).ProcessRunner(ProcessRunOptions defaults)constructor: baseline options applied to every call, with per-call options overriding field-by-field (the environment is unioned, per-call key winning).- Interactive standard input:
ProcessRunOptions.KeepStandardInputOpenkeeps stdin open after start and exposesIRunningProcess.StandardInput(IProcessStandardInput:WriteAsync/WriteLineAsync/FlushAsync/CompleteAsync) for write-then-read (REPL) processes. The bulk helpers force it off. - A BenchmarkDotNet project (
benchmarks/ProcessKit.Benchmarks) measuring process start/exit overhead, bulk-capture shapes, streaming throughput, and per-line pump cost. Not part of the package or CI.
Changed
ProcessRunOptions.WorkingDirectoryandProcessRunOptions.Environmentnow apply to every overload (and are inherited fromProcessRunnerdefaults), taking precedence over the suppliedProcessStartInfo; previously they affected only the convenienceStart(executable, arguments, …)overloads.
v1.3.0
Added
ProcessRunOptions.OutputBuffer(OutputBufferPolicywithOutputOverflowMode) caps how many unconsumed stdout/stderr lines are buffered, with a non-blocking drop-oldest/drop-newest policy — closing the OOM risk on chatty processes whose output is never consumed.IRunningProcess.ToResultAsync(...)extension drains an already-started handle into aProcessResult<string>.IRunningProcess.CompletionOrThrowAsync(...)extension awaits the exit code but throwsTimeoutExceptionwhen the process was killed byProcessRunOptions.Timeout.ProcessRunOptions.WorkingDirectoryandProcessRunOptions.Environmentset the working directory and environment for the convenienceStart(executable, arguments, …)overloads.
Changed
GetExitCodeAsyncnow discards stdout/stderr by default (memory-flat) instead of buffering it unboundedly, since it never exposes the output. Supply anOutputBufferpolicy to override.GetBytesOutputAsyncnow throwsOperationCanceledExceptionwhen the caller'sCancellationTokenis cancelled, consistent withGetFullOutputAsync; aTimeoutstill returns a partial result withWasTimedOutset.
Fixed
- Standard input is now always closed at start when no
StandardInputis supplied, matching the documented contract. Previously the child inherited the parent's stdin, so a process that reads stdin (e.g.cat) could block forever when run with no input. - The defensive
ProcessStartInfoclone now mirrors the caller's environment exactly. Previously an environment variable removed fromProcessStartInfo.Environmentcould reappear in the started process, because the clone was seeded with the current process environment and never cleared. - A user-supplied stdin source (
FromStream/FromLines/FromEnumerable) that throws no longer lets the exception escape fromIRunningProcess.DisposeAsync; the failure is contained and the child receives whatever was written before it, then EOF. IRunningProcess.CpuTimeandPeakMemoryBytesnow refresh the underlying counters before sampling, so repeated live reads report current values instead of a stale first-read snapshot.
v1.2.0
Added
IProcessRunnerinterface andProcessRunnerdefault implementation for executing external commands with full lifetime management viaProcessGroup.ProcessRunner.Defaultstatic singleton for casual use without DI.IRunningProcesshandle exposingStdOut/StdErrasIAsyncEnumerable<string>, line counters,Pid,StartTime,Duration,CpuTime,PeakMemoryBytes,WasTimedOut,Exitedcancellation token, andCompletiontask.ProcessResult<T>record carryingStdOut,StdErr,ExitCode,WasTimedOut,IsSuccess, and fluentEnsureSuccess().ProcessExitExceptionraised byEnsureSuccess()on non-zero exit, carryingExitCodeand the capturedStdErr.ProcessRunOptions(record) for stdin, stderr/stdout handlers, sharedProcessGroup, timeout, and encoding overrides.StandardInputclosed union with factoriesEmpty,FromString,FromBytes,FromStream,FromLines(async),FromEnumerable(sync), andFromFile(eagerly validated path).- Extension methods on
IProcessRunner:Start(exe, args)convenience overload,GetOutputAsync,GetFirstLineOutputAsync,GetFullOutputAsync,GetBytesOutputAsync,GetExitCodeAsync, syncGetOutput/GetFirstLineOutput, andTask<ProcessResult<T>>.EnsureSuccessAsync().
Changed
- README slimmed for the NuGet package page: contributor-only "Running tests on Linux from Windows" guide moved to
docs/linux-testing.md. - README intro and NuGet package description rewritten to reflect both surfaces (
ProcessGrouplifetime layer +ProcessRunnerasync-first command runner).
v1.1.1
Changed
- Use latest git tag (or 0.0.0) as previous version baseline
Removed
- Remove self-signed NuGet author signing
v1.1.0
Changed
- Initial commit
- Fixed initial workflow
- Updated certificate
Fixed
- Fix release workflow when previous tag does not exist