Class RequestContextMiddleware
- Namespace
- IceRpc.RequestContext
- Assembly
- IceRpc.RequestContext.dll
Represents a middleware that decodes request context fields into request context features.
public class RequestContextMiddleware : IDispatcher
- Inheritance
-
RequestContextMiddleware
- Implements
- Inherited Members
Remarks
Both the ice protocol and the icerpc protocol can transmit request context fields with requests; while icerpc can transmit all request fields, ice can only transmit request context fields and idempotent fields.
Constructors
RequestContextMiddleware(IDispatcher)
Constructs a request context middleware.
public RequestContextMiddleware(IDispatcher next)
Parameters
next
IDispatcherThe next dispatcher in the dispatch pipeline.
Methods
DispatchAsync(IncomingRequest, CancellationToken)
Dispatches an incoming request and returns the corresponding outgoing response.
public ValueTask<OutgoingResponse> DispatchAsync(IncomingRequest request, CancellationToken cancellationToken)
Parameters
request
IncomingRequestThe incoming request being dispatched.
cancellationToken
CancellationTokenA cancellation token that receives the cancellation requests.
Returns
- ValueTask<OutgoingResponse>
The corresponding OutgoingResponse.