Class RequestReplyEngine
- Namespace
- AnyProtocol
- Assembly
- AnyProtocol.dll
Provides the request reply engine implementation used by AnyProtocol applications.
public sealed class RequestReplyEngine : IAsyncDisposable
- Inheritance
-
RequestReplyEngine
- Implements
- Inherited Members
Constructors
RequestReplyEngine(IMessagingProtocol, IMessageEnvelopeFactory?)
Initializes a new instance of the RequestReplyEngine class.
public RequestReplyEngine(IMessagingProtocol transport, IMessageEnvelopeFactory? envelopeFactory = null)
Parameters
transportIMessagingProtocolThe transport.
envelopeFactoryIMessageEnvelopeFactoryThe message metadata factory.
Methods
DisposeAsync()
Asynchronously releases resources owned by this instance.
public ValueTask DisposeAsync()
Returns
- ValueTask
A task that represents the asynchronous operation.
RequestAsync(string, TransportEnvelope, TimeSpan, CancellationToken)
Sends a request and waits asynchronously for its response.
public ValueTask<TransportEnvelope> RequestAsync(string channel, TransportEnvelope request, TimeSpan timeout, CancellationToken cancellationToken = default)
Parameters
channelstringThe logical message channel.
requestTransportEnvelopeThe request to process.
timeoutTimeSpanThe maximum time allowed for the operation.
cancellationTokenCancellationTokenThe token used to cancel the operation.
Returns
- ValueTask<TransportEnvelope>
A task whose result contains the request async.
RequestAsync(string, TransportEnvelope, TimeSpan, CancellationToken, ContractMethodDescriptor?)
Sends a request and waits for its response.
public ValueTask<TransportEnvelope> RequestAsync(string channel, TransportEnvelope request, TimeSpan timeout, CancellationToken cancellationToken, ContractMethodDescriptor? method)
Parameters
channelstringThe request channel.
requestTransportEnvelopeThe request to process.
timeoutTimeSpanThe maximum time allowed for the operation.
cancellationTokenCancellationTokenThe token used to cancel the operation.
methodContractMethodDescriptorThe optional contract method metadata.
Returns
- ValueTask<TransportEnvelope>
A task whose result contains the request async.