AsyncHelperDoOperationAsync(ActionIAsyncContext, TaskConfig) Method

Executes the specified operation asynchronously.
See the Examples section of the AsyncHelper class for details.

Definition

Namespace: KGySoft.Threading
Assembly: KGySoft.CoreLibraries (in KGySoft.CoreLibraries.dll) Version: 8.2.0
C#
public static Task DoOperationAsync(
	Action<IAsyncContext> operation,
	TaskConfig? asyncConfig
)

Parameters

operation  ActionIAsyncContext
The operation to be executed.
asyncConfig  TaskConfig
The configuration for the asynchronous operation.

Return Value

Task
A Task that represents the asynchronous operation, which could still be pending.

Exceptions

ArgumentNullExceptionoperation is .
TaskCanceledExceptionThe operation has been canceled and ThrowIfCanceled in asyncConfig was . This exception is thrown when the result is awaited.

See Also