Table of Contents

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

transport IMessagingProtocol

The transport.

envelopeFactory IMessageEnvelopeFactory

The 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

channel string

The logical message channel.

request TransportEnvelope

The request to process.

timeout TimeSpan

The maximum time allowed for the operation.

cancellationToken CancellationToken

The 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

channel string

The request channel.

request TransportEnvelope

The request to process.

timeout TimeSpan

The maximum time allowed for the operation.

cancellationToken CancellationToken

The token used to cancel the operation.

method ContractMethodDescriptor

The optional contract method metadata.

Returns

ValueTask<TransportEnvelope>

A task whose result contains the request async.