Class IceProxyExtensions
- Namespace
- IceRpc.Ice.Operations
- Assembly
- IceRpc.Ice.dll
Provides helper methods for generated proxy structs.
public static class IceProxyExtensions
- Inheritance
-
IceProxyExtensions
- Inherited Members
Methods
InvokeOperationAsync<TProxy>(TProxy, string, PipeReader, ResponseDecodeFunc, IFeatureCollection?, bool, bool, CancellationToken)
Sends a request to a service and decodes the "void" response.
public static Task InvokeOperationAsync<TProxy>(this TProxy proxy, string operation, PipeReader payload, ResponseDecodeFunc responseDecodeFunc, IFeatureCollection? features = null, bool idempotent = false, bool oneway = false, CancellationToken cancellationToken = default) where TProxy : struct, IIceProxy
Parameters
proxyTProxyA proxy for the remote service.
operationstringThe name of the operation, as specified in Ice Slice.
payloadPipeReaderThe payload of the request.
responseDecodeFuncResponseDecodeFuncThe decode function for the response payload. It decodes and throws an exception when the status code of the response is ApplicationError.
featuresIFeatureCollectionThe invocation features.
idempotentboolWhen true, the request is idempotent.
onewayboolWhen true, the request is sent one-way and an empty response is returned immediately after sending the request.
cancellationTokenCancellationTokenA cancellation token that receives the cancellation requests.
Returns
- Task
A task that completes when the void response is returned.
Type Parameters
TProxyThe type of the proxy struct.
Exceptions
- IceException
Thrown if the response carries a failure.
InvokeOperationAsync<TProxy, T>(TProxy, string, PipeReader, ResponseDecodeFunc<T>, IFeatureCollection?, bool, CancellationToken)
Sends a request to a service and decodes the response.
public static Task<T> InvokeOperationAsync<TProxy, T>(this TProxy proxy, string operation, PipeReader payload, ResponseDecodeFunc<T> responseDecodeFunc, IFeatureCollection? features = null, bool idempotent = false, CancellationToken cancellationToken = default) where TProxy : struct, IIceProxy
Parameters
proxyTProxyA proxy to the remote service.
operationstringThe name of the operation, as specified in Ice Slice.
payloadPipeReaderThe payload of the request.
responseDecodeFuncResponseDecodeFunc<T>The decode function for the response payload. It decodes and throws an exception when the status code of the response is ApplicationError.
featuresIFeatureCollectionThe invocation features.
idempotentboolWhen true, the request is idempotent.
cancellationTokenCancellationTokenA cancellation token that receives the cancellation requests.
Returns
- Task<T>
The operation's return value.
Type Parameters
TProxyThe type of the proxy struct.
TThe response type.
Exceptions
- IceException
Thrown if the response carries an Ice exception.