| | 1 | | // Copyright (c) ZeroC, Inc. |
| | 2 | |
|
| | 3 | | namespace IceRpc; |
| | 4 | |
|
| | 5 | | /// <summary>Implements the <see cref="IInvoker" /> interface by always throwing |
| | 6 | | /// <see cref="InvalidOperationException" />.</summary> |
| | 7 | | public class InvalidInvoker : IInvoker |
| | 8 | | { |
| | 9 | | /// <summary>Gets the singleton instance of <see cref="InvalidInvoker" />.</summary> |
| 90 | 10 | | public static IInvoker Instance { get; } = new InvalidInvoker(); |
| | 11 | |
|
| | 12 | | /// <inheritdoc/> |
| | 13 | | public Task<IncomingResponse> InvokeAsync(OutgoingRequest request, CancellationToken cancellationToken = default) => |
| 0 | 14 | | throw new InvalidOperationException("Invalid invoker."); |
| | 15 | |
|
| 3 | 16 | | private InvalidInvoker() |
| 3 | 17 | | { |
| 3 | 18 | | } |
| | 19 | | } |