Table of Contents

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

proxy TProxy

A proxy for the remote service.

operation string

The name of the operation, as specified in Ice Slice.

payload PipeReader

The payload of the request.

responseDecodeFunc ResponseDecodeFunc

The decode function for the response payload. It decodes and throws an exception when the status code of the response is ApplicationError.

features IFeatureCollection

The invocation features.

idempotent bool

When true, the request is idempotent.

oneway bool

When true, the request is sent one-way and an empty response is returned immediately after sending the request.

cancellationToken CancellationToken

A cancellation token that receives the cancellation requests.

Returns

Task

A task that completes when the void response is returned.

Type Parameters

TProxy

The 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

proxy TProxy

A proxy to the remote service.

operation string

The name of the operation, as specified in Ice Slice.

payload PipeReader

The payload of the request.

responseDecodeFunc ResponseDecodeFunc<T>

The decode function for the response payload. It decodes and throws an exception when the status code of the response is ApplicationError.

features IFeatureCollection

The invocation features.

idempotent bool

When true, the request is idempotent.

cancellationToken CancellationToken

A cancellation token that receives the cancellation requests.

Returns

Task<T>

The operation's return value.

Type Parameters

TProxy

The type of the proxy struct.

T

The response type.

Exceptions

IceException

Thrown if the response carries an Ice exception.