Class DeadlineMiddleware
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
Constructors
DeadlineMiddleware(IDispatcher)
Constructs a deadline middleware.
public DeadlineMiddleware(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 = default)
Parameters
request
IncomingRequestThe incoming request being dispatched.
cancellationToken
CancellationTokenA cancellation token that receives the cancellation requests.
Returns
- ValueTask<OutgoingResponse>
The outgoing response.