Table of Contents

Interface IRequestHandler<TRequest, TResponse>

Namespace
Arbiter.Mediation
Assembly
Arbiter.Mediation.dll

An interface for a request handler

public interface IRequestHandler<in TRequest, TResponse> where TRequest : IRequest<TResponse>

Type Parameters

TRequest

The type of request being handled

TResponse

The type of response from the handler

Remarks

There should be only one handlers for a request. Use IPipelineBehavior<TRequest, TResponse> to create a pipeline of additional behaviors.

Methods

Handle(TRequest, CancellationToken)

Handles a request and returns the response

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

Parameters

request TRequest

The request to handle

cancellationToken CancellationToken

Cancellation token

Returns

ValueTask<TResponse>

Awaitable task returning the TResponse

Exceptions

ArgumentNullException

When request is null