Skip to content

Add parallel DiffPipeline with progress reporting and cancellation (#260)#266

Merged
JusterZhu merged 1 commit into
masterfrom
refactor/differential-pipeline
May 23, 2026
Merged

Add parallel DiffPipeline with progress reporting and cancellation (#260)#266
JusterZhu merged 1 commit into
masterfrom
refactor/differential-pipeline

Conversation

@JusterZhu
Copy link
Copy Markdown
Collaborator

Closes #260

Summary

New DiffPipeline class for parallel file processing with progress reporting and CancellationToken support throughout.

Changes

New Files

  • Pipeline/DiffPipeline.cs — parallel orchestrator using SemaphoreSlim-throttled Task.Run
  • Pipeline/DiffPipelineOptions.cs — configurable parallelism, error strategy
  • Models/DiffProgress.cs — progress struct with percentage, current file, error info

Design

  • Throttled parallelism: SemaphoreSlim(MaxDegreeOfParallelism) limits concurrency (default: CPU cores)
  • Per-file error isolation: one file failing does not stop others; errors reported via progress
  • Full cancellation: CancellationToken propagated to every file-level diff
  • Progress: IProgress reports completed/total, current file, percentage
  • Zero new dependencies: SemaphoreSlim, IProgress<>, Task.WhenAll — all BCL built-in

Usage Example

var pipeline = new DiffPipeline(new DiffPipelineOptions { MaxDegreeOfParallelism = 8 });
var progress = new Progress<DiffProgress>(p => Console.WriteLine(p));
await pipeline.CleanAsync(oldApp, newApp, patchDir, progress, ct);

…tion. New DiffPipeline class with SemaphoreSlim-throttled parallelism. Configurable MaxDegreeOfParallelism (default: CPU cores). IProgress<DiffProgress> reporting per-file. CancellationToken propagation throughout. Per-file error isolation (one failure doesn't stop others). Closes #260
Copilot AI review requested due to automatic review settings May 23, 2026 06:33
@JusterZhu JusterZhu merged commit 3505baf into master May 23, 2026
1 check failed
@JusterZhu JusterZhu deleted the refactor/differential-pipeline branch May 23, 2026 06:34
@JusterZhu JusterZhu review requested due to automatic review settings May 23, 2026 06:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add parallel pipeline with Channel-based scheduling and cancellation support

1 participant