Skip to main content
Corvus Connection

For Each (Parallel)

Concurrency
flow.forEachParallelRuns the body for every element of a collection in parallel, capped at 'maxDegreeOfParallelism' concurrent items (0 = unbounded). Failure-safe: one item's error is logged and the rest continue.Bounded parallel-foreach over a collection, failure-safe.

Inputs

Name
Kind
Type
Flags
inExecexecmultiplexed
sourceDataanyNone

Outputs

Name
Kind
Type
Flags
bodyExecexecNone
itemDataanymultiplexed
completedExecexecNone

Parameters

Name
Type
Required
Default
Choices
maxDegreeOfParallelismSystem.Int32no4None

Lowers to C#

await Parallel.ForEachAsync(source, new() { MaxDegreeOfParallelism = n }, async (item, ct) => { /* body */ });

Used in