API Reference
Class
ParallelQueryHelper
Minimal helper for running an async workload over a set of inputs with bounded parallelism.
Inheritance
- Object
- ParallelQueryHelper
Methods
public static IAsyncEnumerable<T> RunAsync<T>(IEnumerable<String> items, Func<String, Task<IEnumerable<T>>> work, Int32 degreeOfParallelism, CancellationToken token = null) #Returns:
IAsyncEnumerable<T>Type Parameters
- T
Parameters
- items IEnumerable<String>
- work Func<String, Task<IEnumerable<T>>>
- degreeOfParallelism Int32
- token CancellationToken = null
RunAsync``1(System.Collections.Generic.IEnumerable{System.String} items, System.Func{System.String,System.Threading.Tasks.Task{System.Collections.Generic.IEnumerable{``0}}} work, System.Int32 degreeOfParallelism, System.Threading.CancellationToken token) #Runs work for each input with a maximum of degreeOfParallelism concurrent tasks and yields the results.
Type Parameters
- T
- Item type yielded by the worker.
Parameters
- items System.Collections.Generic.IEnumerable{System.String}
- Sequence of inputs (e.g., hostnames).
- work System.Func{System.String,System.Threading.Tasks.Task{System.Collections.Generic.IEnumerable{``0}}}
- Async function returning zero-or-more results for an input.
- degreeOfParallelism System.Int32
- Max parallelism to use.
- token System.Threading.CancellationToken
- Cancellation token.
Inherited Methods
public override Boolean Equals(Object obj) #Returns:
BooleanInherited from Object
Parameters
- obj Object