Click or drag to resize

TaskUtilitiesRunTasksInParallelT Method (IEnumerableT, FuncT, CancellationToken, Task, CancellationToken, Int32)

Runs a list of tasks in parallel on a list of work items .

Namespace:  ShellBoost.Core.Utilities
Assembly:  ShellBoost.Core (in ShellBoost.Core.dll) Version: 1.8.3.0
Syntax
C#
public static Task RunTasksInParallel<T>(
	IEnumerable<T> workItems,
	Func<T, CancellationToken, Task> work,
	CancellationToken cancellationToken,
	int maxDegreeOfParallelism = 0
)

Parameters

workItems
Type: System.Collections.GenericIEnumerableT
The work items.
work
Type: SystemFuncT, CancellationToken, Task
The work function.
cancellationToken
Type: System.ThreadingCancellationToken
The cancellation token.
maxDegreeOfParallelism (Optional)
Type: SystemInt32
The maximum degree of parallelism. Zero or a negative number means infinite.

Type Parameters

T
The work item type.

Return Value

Type: Task
An instance of the Task class.
Exceptions
ExceptionCondition
ArgumentNullExceptionworkItems or work is null.
See Also