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
TDep1The type of the first injected dependency.
TDep2The 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
requestIncomingRequestThe request being dispatched.
dep1TDep1The first injected dependency.
dep2TDep2The second injected dependency.
cancellationTokenCancellationTokenA cancellation token that receives the cancellation requests.
Returns
- ValueTask<OutgoingResponse>
The response.