Interface IOperationHandler<TInput, TResult>
Handler for an operation.
public interface IOperationHandler<TInput, TResult>
Type Parameters
TInputOperation input type. This should be NoValue to represent no parameter.
TResultOperation result type. This should be NoValue to represent void return type.
Methods
CancelAsync(OperationCancelContext)
Request operation cancel.
Task CancelAsync(OperationCancelContext context)
Parameters
contextOperationCancelContextContext.
Returns
- Task
Task when cancel has been sent.
Exceptions
- HandlerException
Unexpected handler failure.
FetchInfoAsync(OperationFetchInfoContext)
Fetch operation info.
Task<OperationInfo> FetchInfoAsync(OperationFetchInfoContext context)
Parameters
contextOperationFetchInfoContextContext.
Returns
- Task<OperationInfo>
Task with operation info.
Exceptions
- HandlerException
Unexpected handler failure.
FetchResultAsync(OperationFetchResultContext)
Fetch operation result, waiting if necessary.
Task<TResult> FetchResultAsync(OperationFetchResultContext context)
Parameters
contextOperationFetchResultContextContext.
Returns
- Task<TResult>
Task with result contents.
Exceptions
- OperationStillRunningException
Operation still running (after optional wait).
- OperationException
Operation failed.
- HandlerException
Unexpected handler failure.
StartAsync(OperationStartContext, TInput)
Start operation.
Task<OperationStartResult<TResult>> StartAsync(OperationStartContext context, TInput input)
Parameters
contextOperationStartContextContext.
inputTInputInput.
Returns
- Task<OperationStartResult<TResult>>
Task with sync or async result.
Exceptions
- OperationException
Operation failed.
- HandlerException
Unexpected handler failure.