Table of Contents

Class DeadlineMiddleware

Namespace
IceRpc.Deadline
Assembly
IceRpc.Deadline.dll

Represents a middleware that decodes deadline fields into deadline features. When the decoded deadline expires, this middleware cancels the dispatch and returns an OutgoingResponse with status code DeadlineExceeded.

public class DeadlineMiddleware : IDispatcher
Inheritance
DeadlineMiddleware
Implements
Inherited Members

Remarks

If the peer-encoded deadline is too far in the future for this middleware to enforce (more than ~24.8 days from now), the request is rejected with NotSupported instead.

Constructors

DeadlineMiddleware(IDispatcher, TimeProvider?)

Constructs a deadline middleware.

public DeadlineMiddleware(IDispatcher next, TimeProvider? timeProvider = null)

Parameters

next IDispatcher

The next dispatcher in the dispatch pipeline.

timeProvider TimeProvider

The optional time provider used to obtain the current time. If null, it uses System.

Methods

DispatchAsync(IncomingRequest, CancellationToken)

Dispatches an incoming request and returns the corresponding outgoing response.

public ValueTask<OutgoingResponse> DispatchAsync(IncomingRequest request, CancellationToken cancellationToken = default)

Parameters

request IncomingRequest

The incoming request being dispatched.

cancellationToken CancellationToken

A cancellation token that receives the cancellation requests.

Returns

ValueTask<OutgoingResponse>

The outgoing response.

See Also