ForResultAsync Method
Definition
- Assemblies
- Cuemon.Threading.dll
ForResultAsync<TResult>(int, int, Func<int, CancellationToken, Task<TResult>>, Action<AsyncWorkloadOptions>)
Executes a parallel for loop where the return value of the function delegate worker is stored in the same sequential order as the for loop.
public static Task<IReadOnlyCollection<TResult>> ForResultAsync<TResult>(int fromInclusive, int toExclusive, Func<int, CancellationToken, Task<TResult>> worker, Action<AsyncWorkloadOptions> setup = null)
Parameters
fromInclusiveintThe start index, inclusive.
toExclusiveintThe end index, exclusive.
workerFunc<int, CancellationToken, Task<TResult>>The delegate that is invoked once per iteration.
setupAction<AsyncWorkloadOptions>The AsyncWorkloadOptions which may be configured.
Returns
- Task<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 as the for loop.
Type Parameters
TResultThe type of the return value of the function delegate
worker.
ForResultAsync<T, TResult>(int, int, Func<int, T, CancellationToken, Task<TResult>>, T, Action<AsyncWorkloadOptions>)
Executes a parallel for loop where the return value of the function delegate worker is stored in the same sequential order as the for loop.
public static Task<IReadOnlyCollection<TResult>> ForResultAsync<T, TResult>(int fromInclusive, int toExclusive, Func<int, T, CancellationToken, Task<TResult>> worker, T arg, Action<AsyncWorkloadOptions> setup = null)
Parameters
fromInclusiveintThe start index, inclusive.
toExclusiveintThe end index, exclusive.
workerFunc<int, T, CancellationToken, Task<TResult>>The delegate that is invoked once per iteration.
argTThe parameter of the function delegate
worker.setupAction<AsyncWorkloadOptions>The AsyncWorkloadOptions which may be configured.
Returns
- Task<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 as the for loop.
Type Parameters
TThe type of the parameter of the function delegate
worker.TResultThe type of the return value of the function delegate
worker.
ForResultAsync<T1, T2, TResult>(int, int, Func<int, T1, T2, CancellationToken, Task<TResult>>, T1, T2, Action<AsyncWorkloadOptions>)
Executes a parallel for loop where the return value of the function delegate worker is stored in the same sequential order as the for loop.
public static Task<IReadOnlyCollection<TResult>> ForResultAsync<T1, T2, TResult>(int fromInclusive, int toExclusive, Func<int, T1, T2, CancellationToken, Task<TResult>> worker, T1 arg1, T2 arg2, Action<AsyncWorkloadOptions> setup = null)
Parameters
fromInclusiveintThe start index, inclusive.
toExclusiveintThe end index, exclusive.
workerFunc<int, T1, T2, CancellationToken, Task<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<AsyncWorkloadOptions>The AsyncWorkloadOptions which may be configured.
Returns
- Task<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 as the for loop.
Type Parameters
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.
ForResultAsync<T1, T2, T3, TResult>(int, int, Func<int, T1, T2, T3, CancellationToken, Task<TResult>>, T1, T2, T3, Action<AsyncWorkloadOptions>)
Executes a parallel for loop where the return value of the function delegate worker is stored in the same sequential order as the for loop.
public static Task<IReadOnlyCollection<TResult>> ForResultAsync<T1, T2, T3, TResult>(int fromInclusive, int toExclusive, Func<int, T1, T2, T3, CancellationToken, Task<TResult>> worker, T1 arg1, T2 arg2, T3 arg3, Action<AsyncWorkloadOptions> setup = null)
Parameters
fromInclusiveintThe start index, inclusive.
toExclusiveintThe end index, exclusive.
workerFunc<int, T1, T2, T3, CancellationToken, Task<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<AsyncWorkloadOptions>The AsyncWorkloadOptions which may be configured.
Returns
- Task<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 as the for loop.
Type Parameters
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.
ForResultAsync<T1, T2, T3, T4, TResult>(int, int, Func<int, T1, T2, T3, T4, CancellationToken, Task<TResult>>, T1, T2, T3, T4, Action<AsyncWorkloadOptions>)
Executes a parallel for loop where the return value of the function delegate worker is stored in the same sequential order as the for loop.
public static Task<IReadOnlyCollection<TResult>> ForResultAsync<T1, T2, T3, T4, TResult>(int fromInclusive, int toExclusive, Func<int, T1, T2, T3, T4, CancellationToken, Task<TResult>> worker, T1 arg1, T2 arg2, T3 arg3, T4 arg4, Action<AsyncWorkloadOptions> setup = null)
Parameters
fromInclusiveintThe start index, inclusive.
toExclusiveintThe end index, exclusive.
workerFunc<int, T1, T2, T3, T4, CancellationToken, Task<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<AsyncWorkloadOptions>The AsyncWorkloadOptions which may be configured.
Returns
- Task<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 as the for loop.
Type Parameters
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.
ForResultAsync<T1, T2, T3, T4, T5, TResult>(int, int, Func<int, T1, T2, T3, T4, T5, CancellationToken, Task<TResult>>, T1, T2, T3, T4, T5, Action<AsyncWorkloadOptions>)
Executes a parallel for loop where the return value of the function delegate worker is stored in the same sequential order as the for loop.
public static Task<IReadOnlyCollection<TResult>> ForResultAsync<T1, T2, T3, T4, T5, TResult>(int fromInclusive, int toExclusive, Func<int, T1, T2, T3, T4, T5, CancellationToken, Task<TResult>> worker, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, Action<AsyncWorkloadOptions> setup = null)
Parameters
fromInclusiveintThe start index, inclusive.
toExclusiveintThe end index, exclusive.
workerFunc<int, T1, T2, T3, T4, T5, CancellationToken, Task<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<AsyncWorkloadOptions>The AsyncWorkloadOptions which may be configured.
Returns
- Task<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 as the for loop.
Type Parameters
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.
ForResultAsync<TResult>(long, long, Func<long, CancellationToken, Task<TResult>>, Action<AsyncWorkloadOptions>)
Executes a parallel for loop where the return value of the function delegate worker is stored in the same sequential order as the for loop.
public static Task<IReadOnlyCollection<TResult>> ForResultAsync<TResult>(long fromInclusive, long toExclusive, Func<long, CancellationToken, Task<TResult>> worker, Action<AsyncWorkloadOptions> setup = null)
Parameters
fromInclusivelongThe start index, inclusive.
toExclusivelongThe end index, exclusive.
workerFunc<long, CancellationToken, Task<TResult>>The delegate that is invoked once per iteration.
setupAction<AsyncWorkloadOptions>The AsyncWorkloadOptions which may be configured.
Returns
- Task<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 as the for loop.
Type Parameters
TResultThe type of the return value of the function delegate
worker.
ForResultAsync<T, TResult>(long, long, Func<long, T, CancellationToken, Task<TResult>>, T, Action<AsyncWorkloadOptions>)
Executes a parallel for loop where the return value of the function delegate worker is stored in the same sequential order as the for loop.
public static Task<IReadOnlyCollection<TResult>> ForResultAsync<T, TResult>(long fromInclusive, long toExclusive, Func<long, T, CancellationToken, Task<TResult>> worker, T arg, Action<AsyncWorkloadOptions> setup = null)
Parameters
fromInclusivelongThe start index, inclusive.
toExclusivelongThe end index, exclusive.
workerFunc<long, T, CancellationToken, Task<TResult>>The delegate that is invoked once per iteration.
argTThe parameter of the function delegate
worker.setupAction<AsyncWorkloadOptions>The AsyncWorkloadOptions which may be configured.
Returns
- Task<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 as the for loop.
Type Parameters
TThe type of the parameter of the function delegate
worker.TResultThe type of the return value of the function delegate
worker.
ForResultAsync<T1, T2, TResult>(long, long, Func<long, T1, T2, CancellationToken, Task<TResult>>, T1, T2, Action<AsyncWorkloadOptions>)
Executes a parallel for loop where the return value of the function delegate worker is stored in the same sequential order as the for loop.
public static Task<IReadOnlyCollection<TResult>> ForResultAsync<T1, T2, TResult>(long fromInclusive, long toExclusive, Func<long, T1, T2, CancellationToken, Task<TResult>> worker, T1 arg1, T2 arg2, Action<AsyncWorkloadOptions> setup = null)
Parameters
fromInclusivelongThe start index, inclusive.
toExclusivelongThe end index, exclusive.
workerFunc<long, T1, T2, CancellationToken, Task<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<AsyncWorkloadOptions>The AsyncWorkloadOptions which may be configured.
Returns
- Task<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 as the for loop.
Type Parameters
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.
ForResultAsync<T1, T2, T3, TResult>(long, long, Func<long, T1, T2, T3, CancellationToken, Task<TResult>>, T1, T2, T3, Action<AsyncWorkloadOptions>)
Executes a parallel for loop where the return value of the function delegate worker is stored in the same sequential order as the for loop.
public static Task<IReadOnlyCollection<TResult>> ForResultAsync<T1, T2, T3, TResult>(long fromInclusive, long toExclusive, Func<long, T1, T2, T3, CancellationToken, Task<TResult>> worker, T1 arg1, T2 arg2, T3 arg3, Action<AsyncWorkloadOptions> setup = null)
Parameters
fromInclusivelongThe start index, inclusive.
toExclusivelongThe end index, exclusive.
workerFunc<long, T1, T2, T3, CancellationToken, Task<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<AsyncWorkloadOptions>The AsyncWorkloadOptions which may be configured.
Returns
- Task<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 as the for loop.
Type Parameters
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.
ForResultAsync<T1, T2, T3, T4, TResult>(long, long, Func<long, T1, T2, T3, T4, CancellationToken, Task<TResult>>, T1, T2, T3, T4, Action<AsyncWorkloadOptions>)
Executes a parallel for loop where the return value of the function delegate worker is stored in the same sequential order as the for loop.
public static Task<IReadOnlyCollection<TResult>> ForResultAsync<T1, T2, T3, T4, TResult>(long fromInclusive, long toExclusive, Func<long, T1, T2, T3, T4, CancellationToken, Task<TResult>> worker, T1 arg1, T2 arg2, T3 arg3, T4 arg4, Action<AsyncWorkloadOptions> setup = null)
Parameters
fromInclusivelongThe start index, inclusive.
toExclusivelongThe end index, exclusive.
workerFunc<long, T1, T2, T3, T4, CancellationToken, Task<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<AsyncWorkloadOptions>The AsyncWorkloadOptions which may be configured.
Returns
- Task<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 as the for loop.
Type Parameters
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.
ForResultAsync<T1, T2, T3, T4, T5, TResult>(long, long, Func<long, T1, T2, T3, T4, T5, CancellationToken, Task<TResult>>, T1, T2, T3, T4, T5, Action<AsyncWorkloadOptions>)
Executes a parallel for loop where the return value of the function delegate worker is stored in the same sequential order as the for loop.
public static Task<IReadOnlyCollection<TResult>> ForResultAsync<T1, T2, T3, T4, T5, TResult>(long fromInclusive, long toExclusive, Func<long, T1, T2, T3, T4, T5, CancellationToken, Task<TResult>> worker, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, Action<AsyncWorkloadOptions> setup = null)
Parameters
fromInclusivelongThe start index, inclusive.
toExclusivelongThe end index, exclusive.
workerFunc<long, T1, T2, T3, T4, T5, CancellationToken, Task<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<AsyncWorkloadOptions>The AsyncWorkloadOptions which may be configured.
Returns
- Task<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 as the for loop.
Type Parameters
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.