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
TDepThe 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
requestIncomingRequestThe request being dispatched.
depTDepThe injected dependency.
cancellationTokenCancellationTokenA cancellation token that receives the cancellation requests.
Returns
- ValueTask<OutgoingResponse>
The response.