WhileResultAsync Method
Definition
- Assemblies
- Cuemon.Threading.dll
WhileResultAsync<TReader, TElement, TResult>(TReader, Func<Task<bool>>, Func<TReader, TElement>, Func<TElement, CancellationToken, Task<TResult>>, Action<AsyncWorkloadOptions>)
Executes a parallel while loop where the return value of the function delegate worker is stored in the same order as the while loop evaluates true.
public static Task<IReadOnlyCollection<TResult>> WhileResultAsync<TReader, TElement, TResult>(TReader reader, Func<Task<bool>> condition, Func<TReader, TElement> provider, Func<TElement, CancellationToken, Task<TResult>> worker, Action<AsyncWorkloadOptions> setup = null)
Parameters
readerTReaderThe reader that provides forward-only access to data.
conditionFunc<Task<bool>>The function delegate that is responsible for the while loop condition.
providerFunc<TReader, TElement>The function delegate that provides data from the specified
reader.workerFunc<TElement, CancellationToken, Task<TResult>>The delegate that will perform work while
conditionevaluatestrue.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 order as the while loop evaluatestrue.
Type Parameters
TReaderThe type of the
readerthat provides forward-only access to data.TElementThe type of the result provided by
reader.TResultThe type of the return value of the function delegate
worker.
WhileResultAsync<TReader, TElement, T, TResult>(TReader, Func<Task<bool>>, Func<TReader, TElement>, Func<TElement, T, CancellationToken, Task<TResult>>, T, Action<AsyncWorkloadOptions>)
Executes a parallel while loop where the return value of the function delegate worker is stored in the same order as the while loop evaluates true.
public static Task<IReadOnlyCollection<TResult>> WhileResultAsync<TReader, TElement, T, TResult>(TReader reader, Func<Task<bool>> condition, Func<TReader, TElement> provider, Func<TElement, T, CancellationToken, Task<TResult>> worker, T arg, Action<AsyncWorkloadOptions> setup = null)
Parameters
readerTReaderThe reader that provides forward-only access to data.
conditionFunc<Task<bool>>The function delegate that is responsible for the while loop condition.
providerFunc<TReader, TElement>The function delegate that provides data from the specified
reader.workerFunc<TElement, T, CancellationToken, Task<TResult>>The delegate that will perform work while
conditionevaluatestrue.argTThe parameter of the 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 order as the while loop evaluatestrue.
Type Parameters
TReaderThe type of the
readerthat provides forward-only access to data.TElementThe type of the result provided by
reader.TThe type of the parameter of the delegate
worker.TResultThe type of the return value of the function delegate
worker.
WhileResultAsync<TReader, TElement, T1, T2, TResult>(TReader, Func<Task<bool>>, Func<TReader, TElement>, Func<TElement, T1, T2, CancellationToken, Task<TResult>>, T1, T2, Action<AsyncWorkloadOptions>)
Executes a parallel while loop where the return value of the function delegate worker is stored in the same order as the while loop evaluates true.
public static Task<IReadOnlyCollection<TResult>> WhileResultAsync<TReader, TElement, T1, T2, TResult>(TReader reader, Func<Task<bool>> condition, Func<TReader, TElement> provider, Func<TElement, T1, T2, CancellationToken, Task<TResult>> worker, T1 arg1, T2 arg2, Action<AsyncWorkloadOptions> setup = null)
Parameters
readerTReaderThe reader that provides forward-only access to data.
conditionFunc<Task<bool>>The function delegate that is responsible for the while loop condition.
providerFunc<TReader, TElement>The function delegate that provides data from the specified
reader.workerFunc<TElement, T1, T2, CancellationToken, Task<TResult>>The delegate that will perform work while
conditionevaluatestrue.arg1T1The first parameter of the delegate
worker.arg2T2The second parameter of the 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 order as the while loop evaluatestrue.
Type Parameters
TReaderThe type of the
readerthat provides forward-only access to data.TElementThe type of the result provided by
reader.T1The type of the first parameter of the delegate
worker.T2The type of the second parameter of the delegate
worker.TResultThe type of the return value of the function delegate
worker.
WhileResultAsync<TReader, TElement, T1, T2, T3, TResult>(TReader, Func<Task<bool>>, Func<TReader, TElement>, Func<TElement, T1, T2, T3, CancellationToken, Task<TResult>>, T1, T2, T3, Action<AsyncWorkloadOptions>)
Executes a parallel while loop where the return value of the function delegate worker is stored in the same order as the while loop evaluates true.
public static Task<IReadOnlyCollection<TResult>> WhileResultAsync<TReader, TElement, T1, T2, T3, TResult>(TReader reader, Func<Task<bool>> condition, Func<TReader, TElement> provider, Func<TElement, T1, T2, T3, CancellationToken, Task<TResult>> worker, T1 arg1, T2 arg2, T3 arg3, Action<AsyncWorkloadOptions> setup = null)
Parameters
readerTReaderThe reader that provides forward-only access to data.
conditionFunc<Task<bool>>The function delegate that is responsible for the while loop condition.
providerFunc<TReader, TElement>The function delegate that provides data from the specified
reader.workerFunc<TElement, T1, T2, T3, CancellationToken, Task<TResult>>The delegate that will perform work while
conditionevaluatestrue.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
- 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 order as the while loop evaluatestrue.
Type Parameters
TReaderThe type of the
readerthat provides forward-only access to data.TElementThe type of the result provided by
reader.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.TResultThe type of the return value of the function delegate
worker.
WhileResultAsync<TReader, TElement, T1, T2, T3, T4, TResult>(TReader, Func<Task<bool>>, Func<TReader, TElement>, Func<TElement, T1, T2, T3, T4, CancellationToken, Task<TResult>>, T1, T2, T3, T4, Action<AsyncWorkloadOptions>)
Executes a parallel while loop where the return value of the function delegate worker is stored in the same order as the while loop evaluates true.
public static Task<IReadOnlyCollection<TResult>> WhileResultAsync<TReader, TElement, T1, T2, T3, T4, TResult>(TReader reader, Func<Task<bool>> condition, Func<TReader, TElement> provider, Func<TElement, T1, T2, T3, T4, CancellationToken, Task<TResult>> worker, T1 arg1, T2 arg2, T3 arg3, T4 arg4, Action<AsyncWorkloadOptions> setup = null)
Parameters
readerTReaderThe reader that provides forward-only access to data.
conditionFunc<Task<bool>>The function delegate that is responsible for the while loop condition.
providerFunc<TReader, TElement>The function delegate that provides data from the specified
reader.workerFunc<TElement, T1, T2, T3, T4, CancellationToken, Task<TResult>>The delegate that will perform work while
conditionevaluatestrue.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
- 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 order as the while loop evaluatestrue.
Type Parameters
TReaderThe type of the
readerthat provides forward-only access to data.TElementThe type of the result provided by
reader.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.TResultThe type of the return value of the function delegate
worker.
WhileResultAsync<TReader, TElement, T1, T2, T3, T4, T5, TResult>(TReader, Func<Task<bool>>, Func<TReader, TElement>, Func<TElement, T1, T2, T3, T4, T5, CancellationToken, Task<TResult>>, T1, T2, T3, T4, T5, Action<AsyncWorkloadOptions>)
Executes a parallel while loop where the return value of the function delegate worker is stored in the same order as the while loop evaluates true.
public static Task<IReadOnlyCollection<TResult>> WhileResultAsync<TReader, TElement, T1, T2, T3, T4, T5, TResult>(TReader reader, Func<Task<bool>> condition, Func<TReader, TElement> provider, Func<TElement, T1, T2, T3, T4, T5, CancellationToken, Task<TResult>> worker, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, Action<AsyncWorkloadOptions> setup = null)
Parameters
readerTReaderThe reader that provides forward-only access to data.
conditionFunc<Task<bool>>The function delegate that is responsible for the while loop condition.
providerFunc<TReader, TElement>The function delegate that provides data from the specified
reader.workerFunc<TElement, T1, T2, T3, T4, T5, CancellationToken, Task<TResult>>The delegate that will perform work while
conditionevaluatestrue.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
- 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 order as the while loop evaluatestrue.
Type Parameters
TReaderThe type of the
readerthat provides forward-only access to data.TElementThe type of the result provided by
reader.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.TResultThe type of the return value of the function delegate
worker.