Table of Contents

Interface IClientInvoker

Namespace
AnyProtocol.Abstraction
Assembly
AnyProtocol.Abstraction.dll

Defines operations for client invoker.

public interface IClientInvoker

Methods

RequestAsync<TRequest, TResponse>(ContractMethodDescriptor, TRequest, CancellationToken)

Sends a request and waits asynchronously for its response.

ValueTask<TResponse> RequestAsync<TRequest, TResponse>(ContractMethodDescriptor method, TRequest request, CancellationToken cancellationToken = default)

Parameters

method ContractMethodDescriptor

The method.

request TRequest

The request to process.

cancellationToken CancellationToken

The token used to cancel the operation.

Returns

ValueTask<TResponse>

A task whose result contains the value produced by the operation.

Type Parameters

TRequest

The request payload type.

TResponse

The response type.

SendAsync<TRequest>(ContractMethodDescriptor, TRequest, CancellationToken)

Sends a transport envelope to the specified logical channel.

ValueTask SendAsync<TRequest>(ContractMethodDescriptor method, TRequest request, CancellationToken cancellationToken = default)

Parameters

method ContractMethodDescriptor

The method.

request TRequest

The request to process.

cancellationToken CancellationToken

The token used to cancel the operation.

Returns

ValueTask

A task that represents the asynchronous operation.

Type Parameters

TRequest

The request type.

StreamAsync<TRequest, TItem>(ContractMethodDescriptor, TRequest, CancellationToken)

Sends a request and asynchronously yields the streamed response items.

IAsyncEnumerable<TItem> StreamAsync<TRequest, TItem>(ContractMethodDescriptor method, TRequest request, CancellationToken cancellationToken = default)

Parameters

method ContractMethodDescriptor

The method.

request TRequest

The request to process.

cancellationToken CancellationToken

The token used to cancel the operation.

Returns

IAsyncEnumerable<TItem>

An asynchronous sequence of values produced by the operation.

Type Parameters

TRequest

The request payload type.

TItem

The item type.