Table of Contents

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

proxy TProxy

A proxy for the remote service.

operation string

The name of the operation, as specified in Slice.

payload PipeReader

The payload of the request.

payloadContinuation PipeReader

The payload continuation of the request.

responseDecodeFunc ResponseDecodeFunc

The decode function for the response payload.

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.

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

proxy TProxy

A proxy to the remote service.

operation string

The name of the operation, as specified in Slice.

payload PipeReader

The payload of the request.

payloadContinuation PipeReader

The optional payload continuation of the request.

responseDecodeFunc ResponseDecodeFunc<T>

The decode function for the response payload.

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.