Class SliceProxyExtensions
- Namespace
- IceRpc.Slice.Operations
- Assembly
- IceRpc.Slice.dll
Provides extension methods for ISliceProxy and generated proxy structs that implement this interface.
public static class SliceProxyExtensions
- Inheritance
-
SliceProxyExtensions
- Inherited Members
Methods
InvokeOperationAsync<TProxy>(TProxy, string, PipeReader, 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, PipeReader? payloadContinuation, ResponseDecodeFunc responseDecodeFunc, IFeatureCollection? features = null, bool idempotent = false, bool oneway = false, CancellationToken cancellationToken = default) where TProxy : struct, ISliceProxy
Parameters
proxyTProxyA proxy for the remote service.
operationstringThe name of the operation, as specified in Slice.
payloadPipeReaderThe payload of the request.
payloadContinuationPipeReaderThe payload continuation of the request.
responseDecodeFuncResponseDecodeFuncThe decode function for the response payload.
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.
InvokeOperationAsync<TProxy, T>(TProxy, string, PipeReader, 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, PipeReader? payloadContinuation, ResponseDecodeFunc<T> responseDecodeFunc, IFeatureCollection? features = null, bool idempotent = false, CancellationToken cancellationToken = default) where TProxy : struct, ISliceProxy
Parameters
proxyTProxyA proxy to the remote service.
operationstringThe name of the operation, as specified in Slice.
payloadPipeReaderThe payload of the request.
payloadContinuationPipeReaderThe optional payload continuation of the request.
responseDecodeFuncResponseDecodeFunc<T>The decode function for the response payload.
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.