Table of Contents

Class AnyProtocolClientInvoker

Namespace
AnyProtocol
Assembly
AnyProtocol.dll

Provides the anyprotocol client invoker implementation used by AnyProtocol applications.

public sealed class AnyProtocolClientInvoker : IClientInvoker, IAsyncDisposable
Inheritance
AnyProtocolClientInvoker
Implements
Inherited Members

Constructors

AnyProtocolClientInvoker(TransportRegistry, IMessageSerializer, IEnumerable<ClientRegistration>, OutboundOperationExecutor, IMessageEnvelopeFactory?, LargePayloadOffloader?, LargePayloadMaterializer?)

Initializes a new instance of the AnyProtocolClientInvoker class.

public AnyProtocolClientInvoker(TransportRegistry transports, IMessageSerializer serializer, IEnumerable<ClientRegistration> registrations, OutboundOperationExecutor executor, IMessageEnvelopeFactory? envelopeFactory = null, LargePayloadOffloader? payloadOffloader = null, LargePayloadMaterializer? payloadMaterializer = null)

Parameters

transports TransportRegistry

The transports.

serializer IMessageSerializer

The serializer.

registrations IEnumerable<ClientRegistration>

The registrations.

executor OutboundOperationExecutor

The outbound operation executor.

envelopeFactory IMessageEnvelopeFactory

The message metadata factory.

payloadOffloader LargePayloadOffloader

The optional outbound payload processor.

payloadMaterializer LargePayloadMaterializer

The optional inbound payload processor.

Methods

DisposeAsync()

Asynchronously releases resources owned by this instance.

public ValueTask DisposeAsync()

Returns

ValueTask

A task that represents the asynchronous operation.

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

Performs the request async<t request, t response> operation.

public 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 request async<t request, t response>.

Type Parameters

TRequest

The request payload type.

TResponse

The response type.

SendAsync<TRequest>(ContractMethodDescriptor, TRequest, CancellationToken)

Performs the send async<t request> operation.

public 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)

Performs the stream async<t request, t item> operation.

public 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.