AsyncHelperFromResultTResult(TResult, ParallelConfig) Method
This method can be used to immediately return from a synchronous operation that has a return value.
See the
Examples section of the
AsyncHelper class for details.
Namespace: KGySoft.ThreadingAssembly: KGySoft.CoreLibraries (in KGySoft.CoreLibraries.dll) Version: 10.0.0
public static TResult FromResult<TResult>(
TResult result,
ParallelConfig? configuration
)
Public Shared Function FromResult(Of TResult) (
result As TResult,
configuration As ParallelConfig
) As TResult
public:
generic<typename TResult>
static TResult FromResult(
TResult result,
ParallelConfig^ configuration
)
static member FromResult :
result : 'TResult *
configuration : ParallelConfig -> 'TResult
- result TResult
- The result to be returned if the operation was not canceled.
- configuration ParallelConfig
- The configuration for the operation.
- TResult
- The type of the result.
TResultresult 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
.