ForEach Method
- Namespace
- SatorImaging.UnityFundamentals
ForEach<TSource, TResult>(int, IEnumerable<TSource>, Func<TSource, Task<TResult>>)
public static Fibers<TSource, TResult> ForEach<TSource, TResult>(int concurrency, IEnumerable<TSource> items, Func<TSource, Task<TResult>> factory)
Creates a new Fibers<TSource, TValue> instance for processing a collection of items.
Parameters
concurrencyintThe maximum number of concurrent tasks.
itemsIEnumerable<TSource>The collection of items to process.
factoryFunc<TSource, Task<TResult>>A function that takes an item of type
TSourceand returns a Task<TResult>.
Returns
- Fibers<TSource, TResult>
A new Fibers<TSource, TValue> instance.
Type Parameters
TSourceThe type of the source items.
TResultThe type of the result produced by the factory function.