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
transportsTransportRegistryThe transports.
serializerIMessageSerializerThe serializer.
registrationsIEnumerable<ClientRegistration>The registrations.
executorOutboundOperationExecutorThe outbound operation executor.
envelopeFactoryIMessageEnvelopeFactoryThe message metadata factory.
payloadOffloaderLargePayloadOffloaderThe optional outbound payload processor.
payloadMaterializerLargePayloadMaterializerThe 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
methodContractMethodDescriptorThe method.
requestTRequestThe request to process.
cancellationTokenCancellationTokenThe token used to cancel the operation.
Returns
- ValueTask<TResponse>
A task whose result contains the request async<t request, t response>.
Type Parameters
TRequestThe request payload type.
TResponseThe 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
methodContractMethodDescriptorThe method.
requestTRequestThe request to process.
cancellationTokenCancellationTokenThe token used to cancel the operation.
Returns
- ValueTask
A task that represents the asynchronous operation.
Type Parameters
TRequestThe 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
methodContractMethodDescriptorThe method.
requestTRequestThe request to process.
cancellationTokenCancellationTokenThe token used to cancel the operation.
Returns
- IAsyncEnumerable<TItem>
An asynchronous sequence of values produced by the operation.
Type Parameters
TRequestThe request payload type.
TItemThe item type.