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
methodContractMethodDescriptorThe method.
requestTRequestThe request to process.
cancellationTokenCancellationTokenThe token used to cancel the operation.
Returns
- ValueTask<TResponse>
A task whose result contains the value produced by the operation.
Type Parameters
TRequestThe request payload type.
TResponseThe 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
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)
Sends a request and asynchronously yields the streamed response items.
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.