Interface IPipelineBehavior<TMessage>
Defines a behaviour that can be plugged into the message handling pipeline. Behaviours are executed in a chain around the core handler logic.
Namespace: Chapar.Core.Pipeline
Assembly: Chapar.Core.dll
Syntax
public interface IPipelineBehavior<in TMessage> where TMessage : IMessage
Type Parameters
| Name | Description |
|---|---|
| TMessage | The type of the message being handled. |
Methods
| Edit this page View SourceHandleAsync(TMessage, Func<Task>, CancellationToken)
Executes the behaviour and optionally calls the next delegate in the pipeline.
Declaration
Task HandleAsync(TMessage message, Func<Task> next, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| TMessage | message | The message to process. |
| Func<Task> | next | A delegate representing the next action in the pipeline. |
| CancellationToken | cancellationToken | Token to cancel the operation. |
Returns
| Type | Description |
|---|---|
| Task |