AsyncHelperDoOperationSynchronouslyTResult(FuncIAsyncContext, TResult, ParallelConfig) Method

Executes the specified operation synchronously, in which some sub-operations may run in parallel.
See the Examples section of the AsyncHelper class for details.

Definition

Namespace: KGySoft.Threading
Assembly: KGySoft.CoreLibraries (in KGySoft.CoreLibraries.dll) Version: 8.1.0
C#
public static TResult DoOperationSynchronously<TResult>(
	Func<IAsyncContext, TResult> operation,
	ParallelConfig? configuration
)

Parameters

operation  FuncIAsyncContext, TResult
The operation to be executed.
configuration  ParallelConfig
The configuration for the operation.

Type Parameters

TResult
The type of the result of the specified operation.

Return Value

TResult
The result of the operation if the operation has not been canceled, or the default value of TResult if the operation has been canceled and ThrowIfCanceled in configuration was set to .

Exceptions

ArgumentNullExceptionoperation is .
OperationCanceledExceptionThe operation has been canceled and ThrowIfCanceled in configuration was .

See Also