ForEachResult Method
Definition
- Assemblies
- Cuemon.Threading.dll
ForEachResult<TSource, TResult>(IEnumerable<TSource>, Func<TSource, TResult>, Action<AsyncTaskFactoryOptions>)
Executes a parallel foreach loop where the return value of the function delegate worker is stored in the same sequential order as source.
public static IReadOnlyCollection<TResult> ForEachResult<TSource, TResult>(IEnumerable<TSource> source, Func<TSource, TResult> worker, Action<AsyncTaskFactoryOptions> setup = null)
Parameters
sourceIEnumerable<TSource>The sequence to iterate over parallel.
workerFunc<TSource, TResult>The delegate that is invoked once per iteration.
setupAction<AsyncTaskFactoryOptions>The AsyncTaskFactoryOptions which may be configured.
Returns
- IReadOnlyCollection<TResult>
A Task that represents the asynchronous operation. The task result contains an IReadOnlyCollection<T> where the return value of the function delegate
workeris stored in the same sequential order assource.
Type Parameters
TSourceThe type of the data in the source.
TResultThe type of the return value of the function delegate
worker.
ForEachResult<TSource, T, TResult>(IEnumerable<TSource>, Func<TSource, T, TResult>, T, Action<AsyncTaskFactoryOptions>)
Executes a parallel foreach loop where the return value of the function delegate worker is stored in the same sequential order as source.
public static IReadOnlyCollection<TResult> ForEachResult<TSource, T, TResult>(IEnumerable<TSource> source, Func<TSource, T, TResult> worker, T arg, Action<AsyncTaskFactoryOptions> setup = null)
Parameters
sourceIEnumerable<TSource>The sequence to iterate over parallel.
workerFunc<TSource, T, TResult>The delegate that is invoked once per iteration.
argTThe parameter of the function delegate
worker.setupAction<AsyncTaskFactoryOptions>The AsyncTaskFactoryOptions which may be configured.
Returns
- IReadOnlyCollection<TResult>
An IReadOnlyCollection<T> where the return value of the function delegate
workeris stored in the same sequential order assource.
Type Parameters
TSourceThe type of the data in the source.
TThe type of the parameter of the function delegate
worker.TResultThe type of the return value of the function delegate
worker.
ForEachResult<TSource, T1, T2, TResult>(IEnumerable<TSource>, Func<TSource, T1, T2, TResult>, T1, T2, Action<AsyncTaskFactoryOptions>)
Executes a parallel foreach loop where the return value of the function delegate worker is stored in the same sequential order as source.
public static IReadOnlyCollection<TResult> ForEachResult<TSource, T1, T2, TResult>(IEnumerable<TSource> source, Func<TSource, T1, T2, TResult> worker, T1 arg1, T2 arg2, Action<AsyncTaskFactoryOptions> setup = null)
Parameters
sourceIEnumerable<TSource>The sequence to iterate over parallel.
workerFunc<TSource, T1, T2, TResult>The delegate that is invoked once per iteration.
arg1T1The first parameter of the function delegate
worker.arg2T2The second parameter of the function delegate
worker.setupAction<AsyncTaskFactoryOptions>The AsyncTaskFactoryOptions which may be configured.
Returns
- IReadOnlyCollection<TResult>
An IReadOnlyCollection<T> where the return value of the function delegate
workeris stored in the same sequential order assource.
Type Parameters
TSourceThe type of the data in the source.
T1The type of the first parameter of the function delegate
worker.T2The type of the second parameter of the function delegate
worker.TResultThe type of the return value of the function delegate
worker.
ForEachResult<TSource, T1, T2, T3, TResult>(IEnumerable<TSource>, Func<TSource, T1, T2, T3, TResult>, T1, T2, T3, Action<AsyncTaskFactoryOptions>)
Executes a parallel foreach loop where the return value of the function delegate worker is stored in the same sequential order as source.
public static IReadOnlyCollection<TResult> ForEachResult<TSource, T1, T2, T3, TResult>(IEnumerable<TSource> source, Func<TSource, T1, T2, T3, TResult> worker, T1 arg1, T2 arg2, T3 arg3, Action<AsyncTaskFactoryOptions> setup = null)
Parameters
sourceIEnumerable<TSource>The sequence to iterate over parallel.
workerFunc<TSource, T1, T2, T3, TResult>The delegate that is invoked once per iteration.
arg1T1The first parameter of the function delegate
worker.arg2T2The second parameter of the function delegate
worker.arg3T3The third parameter of the function delegate
worker.setupAction<AsyncTaskFactoryOptions>The AsyncTaskFactoryOptions which may be configured.
Returns
- IReadOnlyCollection<TResult>
An IReadOnlyCollection<T> where the return value of the function delegate
workeris stored in the same sequential order assource.
Type Parameters
TSourceThe type of the data in the source.
T1The type of the first parameter of the function delegate
worker.T2The type of the second parameter of the function delegate
worker.T3The type of the third parameter of the function delegate
worker.TResultThe type of the return value of the function delegate
worker.
ForEachResult<TSource, T1, T2, T3, T4, TResult>(IEnumerable<TSource>, Func<TSource, T1, T2, T3, T4, TResult>, T1, T2, T3, T4, Action<AsyncTaskFactoryOptions>)
Executes a parallel foreach loop where the return value of the function delegate worker is stored in the same sequential order as source.
public static IReadOnlyCollection<TResult> ForEachResult<TSource, T1, T2, T3, T4, TResult>(IEnumerable<TSource> source, Func<TSource, T1, T2, T3, T4, TResult> worker, T1 arg1, T2 arg2, T3 arg3, T4 arg4, Action<AsyncTaskFactoryOptions> setup = null)
Parameters
sourceIEnumerable<TSource>The sequence to iterate over parallel.
workerFunc<TSource, T1, T2, T3, T4, TResult>The delegate that is invoked once per iteration.
arg1T1The first parameter of the function delegate
worker.arg2T2The second parameter of the function delegate
worker.arg3T3The third parameter of the function delegate
worker.arg4T4The fourth parameter of the function delegate
worker.setupAction<AsyncTaskFactoryOptions>The AsyncTaskFactoryOptions which may be configured.
Returns
- IReadOnlyCollection<TResult>
An IReadOnlyCollection<T> where the return value of the function delegate
workeris stored in the same sequential order assource.
Type Parameters
TSourceThe type of the data in the source.
T1The type of the first parameter of the function delegate
worker.T2The type of the second parameter of the function delegate
worker.T3The type of the third parameter of the function delegate
worker.T4The type of the fourth parameter of the function delegate
worker.TResultThe type of the return value of the function delegate
worker.
ForEachResult<TSource, T1, T2, T3, T4, T5, TResult>(IEnumerable<TSource>, Func<TSource, T1, T2, T3, T4, T5, TResult>, T1, T2, T3, T4, T5, Action<AsyncTaskFactoryOptions>)
Executes a parallel foreach loop
public static IReadOnlyCollection<TResult> ForEachResult<TSource, T1, T2, T3, T4, T5, TResult>(IEnumerable<TSource> source, Func<TSource, T1, T2, T3, T4, T5, TResult> worker, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, Action<AsyncTaskFactoryOptions> setup = null)
Parameters
sourceIEnumerable<TSource>The sequence to iterate over parallel.
workerFunc<TSource, T1, T2, T3, T4, T5, TResult>The delegate that is invoked once per iteration.
arg1T1The first parameter of the function delegate
worker.arg2T2The second parameter of the function delegate
worker.arg3T3The third parameter of the function delegate
worker.arg4T4The fourth parameter of the function delegate
worker.arg5T5The fifth parameter of the function delegate
worker.setupAction<AsyncTaskFactoryOptions>The AsyncTaskFactoryOptions which may be configured.
Returns
- IReadOnlyCollection<TResult>
An IReadOnlyCollection<T> where the return value of the function delegate
workeris stored in the same sequential order assource.
Type Parameters
TSourceThe type of the data in the source.
T1The type of the first parameter of the function delegate
worker.T2The type of the second parameter of the function delegate
worker.T3The type of the third parameter of the function delegate
worker.T4The type of the fourth parameter of the function delegate
worker.T5The type of the fifth parameter of the function delegate
worker.TResultThe type of the return value of the function delegate
worker.