Table of Contents

Interface IMiddleware<TDep>

Namespace
IceRpc.Extensions.DependencyInjection
Assembly
IceRpc.dll

Represents a middleware with a single injected service dependency in its DispatchAsync(IncomingRequest, TDep, CancellationToken) method.

public interface IMiddleware<TDep> where TDep : notnull

Type Parameters

TDep

The type of the injected dependency.

Remarks

This interface is implemented by a middleware that communicates with other middleware via injected services.

Methods

DispatchAsync(IncomingRequest, TDep, CancellationToken)

Dispatches a request and returns a response.

ValueTask<OutgoingResponse> DispatchAsync(IncomingRequest request, TDep dep, CancellationToken cancellationToken)

Parameters

request IncomingRequest

The request being dispatched.

dep TDep

The injected dependency.

cancellationToken CancellationToken

A cancellation token that receives the cancellation requests.

Returns

ValueTask<OutgoingResponse>

The response.

See Also