Table of Contents

Class RequestContextInterceptor

Namespace
IceRpc.RequestContext
Assembly
IceRpc.RequestContext.dll

Represents an interceptor that encodes request context features into request context fields.

public class RequestContextInterceptor : IInvoker
Inheritance
RequestContextInterceptor
Implements
Inherited Members
Extension Methods

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

RequestContextInterceptor(IInvoker)

Constructs a request context interceptor.

public RequestContextInterceptor(IInvoker next)

Parameters

next IInvoker

The next invoker in the invocation pipeline.

Methods

InvokeAsync(OutgoingRequest, CancellationToken)

Sends an outgoing request and returns the corresponding incoming response.

public Task<IncomingResponse> InvokeAsync(OutgoingRequest request, CancellationToken cancellationToken)

Parameters

request OutgoingRequest

The outgoing request being sent.

cancellationToken CancellationToken

A cancellation token that receives the cancellation requests.

Returns

Task<IncomingResponse>

The corresponding IncomingResponse.

Remarks

When request is a two-way request, the returned task will not complete successfully until after the request's Payload is fully sent and the response is received from the peer. When the request is a one-way request, the returned task completes successfully with an empty response when the request's Payload is fully sent. For all requests (one-way and two-way), the sending of the request's PayloadContinuation can continue in a background task after the returned task has completed successfully.