Interface ICancellablePipelineAwareCommandHandler<TCommand, TResult>
Can be implemented to provide basic command handling capabilites where a result and cancellation token support is required and the handler wishes to be able to halt the command handler execution pipeline
Namespace: AzureFromTheTrenches.Commanding.Abstractions
Assembly: AzureFromTheTrenches.Commanding.Abstractions.dll
Syntax
public interface ICancellablePipelineAwareCommandHandler<in TCommand, TResult> : ICancellablePipelineAwareCommandHandler, IPipelineAwareCommandHandler, ICommandHandlerBase where TCommand : ICommand<TResult>
Type Parameters
Name | Description |
---|---|
TCommand | The type of the command |
TResult | The result type of the command |
Methods
| Improve this Doc View SourceExecuteAsync(TCommand, TResult, CancellationToken)
Executes the command
Declaration
Task<PipelineAwareCommandHandlerResult<TResult>> ExecuteAsync(TCommand command, TResult previousResult, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
TCommand | command | The command |
TResult | previousResult | The previous result set by the last (if any) command in the handler chain. Will be default(TResult) if the first command in the pipeline. |
CancellationToken | cancellationToken | A cancellation token |
Returns
Type | Description |
---|---|
Task<PipelineAwareCommandHandlerResult<TResult>> | An awaitable task with the result wrapped in a class that allows the handler to halt execution |