Class EnumerableExtensions
Extension methods on IEnumerable<T>.
Inherited Members
Namespace: DNVGL.One.Compute.Core.Extensions
Assembly: DNVGL.One.Compute.Core.dll
Syntax
public static class EnumerableExtensions
Methods
View SourceForEachAsync<T>(IEnumerable<T>, Func<T, Task>, int)
Execute the given action on every element in the source collection in parallel, with a given degree of parallelism (max. number of parallel tasks).
Declaration
public static Task ForEachAsync<T>(this IEnumerable<T> source, Func<T, Task> action, int degreeOfParallelism = 10)
Parameters
| Type | Name | Description |
|---|---|---|
| IEnumerable<T> | source | The source collection. |
| Func<T, Task> | action | The action to execute on each element in the source collection. |
| int | degreeOfParallelism | The degree of parallelism. Default is 10. |
Returns
| Type | Description |
|---|---|
| Task | Asynchronous Task. |
Type Parameters
| Name | Description |
|---|---|
| T | Element type. |