Table of Contents

Interface IPipelineBehavior<TRequest, TResponse>

Namespace
Arbiter.Mediation
Assembly
Arbiter.Mediation.dll

An interface for a pipeline behavior to surround the inner handler. Implementations add additional behavior and await the next delegate.

public interface IPipelineBehavior<in TRequest, TResponse> where TRequest : notnull

Type Parameters

TRequest

The type of request being sent

TResponse

The type of response from the handler

Remarks

There can be multiple pipeline behaviors for a request handler.

Methods

Handle(TRequest, RequestHandlerDelegate<TResponse>, CancellationToken)

Pipeline handler to perform any additional behavior and await the next delegate as necessary

ValueTask<TResponse?> Handle(TRequest request, RequestHandlerDelegate<TResponse> next, CancellationToken cancellationToken = default)

Parameters

request TRequest

The request being sent

next RequestHandlerDelegate<TResponse>

Awaitable delegate for the next action in the pipeline. Eventually this delegate represents the handler.

cancellationToken CancellationToken

Cancellation token

Returns

ValueTask<TResponse>

Awaitable task returning the TResponse