| | | 1 | | // Copyright (c) ZeroC, Inc. |
| | | 2 | | |
| | | 3 | | namespace IceRpc.Internal; |
| | | 4 | | |
| | | 5 | | /// <summary>A trivial dispatcher that always returns an <see cref="OutgoingResponse"/> with |
| | | 6 | | /// <see cref="StatusCode.NotFound" />.</summary> |
| | | 7 | | internal class NotFoundDispatcher : IDispatcher |
| | | 8 | | { |
| | | 9 | | /// <summary>Gets the unique instance of this class.</summary> |
| | 750 | 10 | | internal static NotFoundDispatcher Instance { get; } = new(); |
| | | 11 | | |
| | | 12 | | /// <inheritdoc/> |
| | | 13 | | public ValueTask<OutgoingResponse> DispatchAsync(IncomingRequest request, CancellationToken cancellationToken = defa |
| | 44 | 14 | | new(new OutgoingResponse(request, StatusCode.NotFound)); |
| | | 15 | | |
| | 3 | 16 | | private NotFoundDispatcher() |
| | 3 | 17 | | { |
| | | 18 | | // Ensures it's a singleton. |
| | 3 | 19 | | } |
| | | 20 | | } |