Interface IMiddleware<TDep1, TDep2, TDep3>
- Namespace
- IceRpc.Extensions.DependencyInjection
- Assembly
- IceRpc.dll
Represents a middleware with 3 injected service dependencies in its DispatchAsync(IncomingRequest, TDep1, TDep2, TDep3, CancellationToken) method.
public interface IMiddleware<TDep1, TDep2, TDep3> where TDep1 : notnull where TDep2 : notnull where TDep3 : notnull
Type Parameters
TDep1The type of the first injected dependency.
TDep2The type of the second injected dependency.
TDep3The type of the third injected dependency.
Remarks
This interface is implemented by a middleware that communicates with other middleware via injected services.
Methods
DispatchAsync(IncomingRequest, TDep1, TDep2, TDep3, CancellationToken)
Dispatches a request and returns a response.
ValueTask<OutgoingResponse> DispatchAsync(IncomingRequest request, TDep1 dep1, TDep2 dep2, TDep3 dep3, CancellationToken cancellationToken)
Parameters
requestIncomingRequestThe request being dispatched.
dep1TDep1The first injected dependency.
dep2TDep2The second injected dependency.
dep3TDep3The third injected dependency.
cancellationTokenCancellationTokenA cancellation token that receives the cancellation requests.
Returns
- ValueTask<OutgoingResponse>
The response.