ForAsync Method
Definition
- Assemblies
- Cuemon.Threading.dll
ForAsync<TOperand>(ForLoopRuleset<TOperand>, Func<TOperand, CancellationToken, Task>, Action<AsyncWorkloadOptions>)
Executes a parallel for loop that offers control of the loop control variable and loop sections.
public static Task ForAsync<TOperand>(ForLoopRuleset<TOperand> rules, Func<TOperand, CancellationToken, Task> worker, Action<AsyncWorkloadOptions> setup = null) where TOperand : struct, IComparable<TOperand>, IEquatable<TOperand>, IConvertible
Parameters
rulesForLoopRuleset<TOperand>The rules of a for-loop control flow statement.
workerFunc<TOperand, CancellationToken, Task>The Task based function delegate that is invoked once per iteration.
setupAction<AsyncWorkloadOptions>The AsyncWorkloadOptions which may be configured.
Returns
Type Parameters
TOperandThe type of the number used with the loop control variable.
Exceptions
- ArgumentNullException
rulescannot be null -or-workercannot be null.
ForAsync<TOperand, T>(ForLoopRuleset<TOperand>, Func<TOperand, T, CancellationToken, Task>, T, Action<AsyncWorkloadOptions>)
Executes a parallel for loop that offers control of the loop control variable and loop sections.
public static Task ForAsync<TOperand, T>(ForLoopRuleset<TOperand> rules, Func<TOperand, T, CancellationToken, Task> worker, T arg, Action<AsyncWorkloadOptions> setup = null) where TOperand : struct, IComparable<TOperand>, IEquatable<TOperand>, IConvertible
Parameters
rulesForLoopRuleset<TOperand>The rules of a for-loop control flow statement.
workerFunc<TOperand, T, CancellationToken, Task>The Task based function delegate that is invoked once per iteration.
argTThe parameter of the delegate
worker.setupAction<AsyncWorkloadOptions>The AsyncWorkloadOptions which may be configured.
Returns
Type Parameters
TOperandThe type of the number used with the loop control variable.
TThe type of the parameter of the delegate
worker.
Exceptions
- ArgumentNullException
rulescannot be null -or-workercannot be null.
ForAsync<TOperand, T1, T2>(ForLoopRuleset<TOperand>, Func<TOperand, T1, T2, CancellationToken, Task>, T1, T2, Action<AsyncWorkloadOptions>)
Executes a parallel for loop that offers control of the loop control variable and loop sections.
public static Task ForAsync<TOperand, T1, T2>(ForLoopRuleset<TOperand> rules, Func<TOperand, T1, T2, CancellationToken, Task> worker, T1 arg1, T2 arg2, Action<AsyncWorkloadOptions> setup = null) where TOperand : struct, IComparable<TOperand>, IEquatable<TOperand>, IConvertible
Parameters
rulesForLoopRuleset<TOperand>The rules of a for-loop control flow statement.
workerFunc<TOperand, T1, T2, CancellationToken, Task>The Task based function delegate that is invoked once per iteration.
arg1T1The first parameter of the delegate
worker.arg2T2The second parameter of the delegate
worker.setupAction<AsyncWorkloadOptions>The AsyncWorkloadOptions which may be configured.
Returns
Type Parameters
TOperandThe type of the number used with the loop control variable.
T1The type of the first parameter of the delegate
worker.T2The type of the second parameter of the delegate
worker.
Exceptions
- ArgumentNullException
rulescannot be null -or-workercannot be null.
ForAsync<TOperand, T1, T2, T3>(ForLoopRuleset<TOperand>, Func<TOperand, T1, T2, T3, CancellationToken, Task>, T1, T2, T3, Action<AsyncWorkloadOptions>)
Executes a parallel for loop that offers control of the loop control variable and loop sections.
public static Task ForAsync<TOperand, T1, T2, T3>(ForLoopRuleset<TOperand> rules, Func<TOperand, T1, T2, T3, CancellationToken, Task> worker, T1 arg1, T2 arg2, T3 arg3, Action<AsyncWorkloadOptions> setup = null) where TOperand : struct, IComparable<TOperand>, IEquatable<TOperand>, IConvertible
Parameters
rulesForLoopRuleset<TOperand>The rules of a for-loop control flow statement.
workerFunc<TOperand, T1, T2, T3, CancellationToken, Task>The Task based function delegate that is invoked once per iteration.
arg1T1The first parameter of the delegate
worker.arg2T2The second parameter of the delegate
worker.arg3T3The third parameter of the delegate
worker.setupAction<AsyncWorkloadOptions>The AsyncWorkloadOptions which may be configured.
Returns
Type Parameters
TOperandThe type of the number used with the loop control variable.
T1The type of the first parameter of the delegate
worker.T2The type of the second parameter of the delegate
worker.T3The type of the third parameter of the delegate
worker.
Exceptions
- ArgumentNullException
rulescannot be null -or-workercannot be null.
ForAsync<TOperand, T1, T2, T3, T4>(ForLoopRuleset<TOperand>, Func<TOperand, T1, T2, T3, T4, CancellationToken, Task>, T1, T2, T3, T4, Action<AsyncWorkloadOptions>)
Executes a parallel for loop that offers control of the loop control variable and loop sections.
public static Task ForAsync<TOperand, T1, T2, T3, T4>(ForLoopRuleset<TOperand> rules, Func<TOperand, T1, T2, T3, T4, CancellationToken, Task> worker, T1 arg1, T2 arg2, T3 arg3, T4 arg4, Action<AsyncWorkloadOptions> setup = null) where TOperand : struct, IComparable<TOperand>, IEquatable<TOperand>, IConvertible
Parameters
rulesForLoopRuleset<TOperand>The rules of a for-loop control flow statement.
workerFunc<TOperand, T1, T2, T3, T4, CancellationToken, Task>The Task based function delegate that is invoked once per iteration.
arg1T1The first parameter of the delegate
worker.arg2T2The second parameter of the delegate
worker.arg3T3The third parameter of the delegate
worker.arg4T4The fourth parameter of the delegate
worker.setupAction<AsyncWorkloadOptions>The AsyncWorkloadOptions which may be configured.
Returns
Type Parameters
TOperandThe type of the number used with the loop control variable.
T1The type of the first parameter of the delegate
worker.T2The type of the second parameter of the delegate
worker.T3The type of the third parameter of the delegate
worker.T4The type of the fourth parameter of the delegate
worker.
Exceptions
- ArgumentNullException
rulescannot be null -or-workercannot be null.
ForAsync<TOperand, T1, T2, T3, T4, T5>(ForLoopRuleset<TOperand>, Func<TOperand, T1, T2, T3, T4, T5, CancellationToken, Task>, T1, T2, T3, T4, T5, Action<AsyncWorkloadOptions>)
Executes a parallel for loop that offers control of the loop control variable and loop sections.
public static Task ForAsync<TOperand, T1, T2, T3, T4, T5>(ForLoopRuleset<TOperand> rules, Func<TOperand, T1, T2, T3, T4, T5, CancellationToken, Task> worker, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, Action<AsyncWorkloadOptions> setup = null) where TOperand : struct, IComparable<TOperand>, IEquatable<TOperand>, IConvertible
Parameters
rulesForLoopRuleset<TOperand>The rules of a for-loop control flow statement.
workerFunc<TOperand, T1, T2, T3, T4, T5, CancellationToken, Task>The Task based function delegate that is invoked once per iteration.
arg1T1The first parameter of the delegate
worker.arg2T2The second parameter of the delegate
worker.arg3T3The third parameter of the delegate
worker.arg4T4The fourth parameter of the delegate
worker.arg5T5The fifth parameter of the delegate
worker.setupAction<AsyncWorkloadOptions>The AsyncWorkloadOptions which may be configured.
Returns
Type Parameters
TOperandThe type of the number used with the loop control variable.
T1The type of the first parameter of the delegate
worker.T2The type of the second parameter of the delegate
worker.T3The type of the third parameter of the delegate
worker.T4The type of the fourth parameter of the delegate
worker.T5The type of the fifth parameter of the delegate
worker.
Exceptions
- ArgumentNullException
rulescannot be null -or-workercannot be null.