Table of Contents

Interface IMiddleware<TDep1, TDep2>

Namespace
IceRpc.Extensions.DependencyInjection
Assembly
IceRpc.dll

Represents a middleware with 2 injected service dependencies in its DispatchAsync(IncomingRequest, TDep1, TDep2, CancellationToken) method.

public interface IMiddleware<TDep1, TDep2> where TDep1 : notnull where TDep2 : notnull

Type Parameters

TDep1

The type of the first injected dependency.

TDep2

The type of the second injected dependency.

Remarks

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

Methods

DispatchAsync(IncomingRequest, TDep1, TDep2, CancellationToken)

Dispatches a request and returns a response.

ValueTask<OutgoingResponse> DispatchAsync(IncomingRequest request, TDep1 dep1, TDep2 dep2, CancellationToken cancellationToken)

Parameters

request IncomingRequest

The request being dispatched.

dep1 TDep1

The first injected dependency.

dep2 TDep2

The second injected dependency.

cancellationToken CancellationToken

A cancellation token that receives the cancellation requests.

Returns

ValueTask<OutgoingResponse>

The response.

See Also