Skip to content

Instantly share code, notes, and snippets.

@wullemsb
Created February 1, 2026 13:13
Show Gist options
  • Select an option

  • Save wullemsb/a10213f6cc0f041c182cd6c5b4451446 to your computer and use it in GitHub Desktop.

Select an option

Save wullemsb/a10213f6cc0f041c182cd6c5b4451446 to your computer and use it in GitHub Desktop.
// Add parallelism with no extra code — just configure the blocks:
var getFolderContents = new TransformManyBlock<string, string>(
folder => Directory.GetFileSystemEntries(folder),
new ExecutionDataflowBlockOptions { MaxDegreeOfParallelism = 4 });
var computeMD5 = new TransformBlock<string, (string FilePath, string Hash)>(
filePath => /* ... */,
new ExecutionDataflowBlockOptions { MaxDegreeOfParallelism = 8 });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment