Table of Contents

Class StreamEngine

Namespace
AnyProtocol
Assembly
AnyProtocol.dll

Provides the stream engine implementation used by AnyProtocol applications.

public sealed class StreamEngine : IAsyncDisposable
Inheritance
StreamEngine
Implements
Inherited Members

Constructors

StreamEngine(IMessagingProtocol, int, IMessageEnvelopeFactory?)

Initializes a new instance of the StreamEngine class.

public StreamEngine(IMessagingProtocol transport, int capacity = 32, IMessageEnvelopeFactory? envelopeFactory = null)

Parameters

transport IMessagingProtocol

The transport.

capacity int

The capacity.

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.

StreamAsync(string, TransportEnvelope, TimeSpan, CancellationToken)

Performs the stream async operation.

public IAsyncEnumerable<TransportEnvelope> StreamAsync(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

IAsyncEnumerable<TransportEnvelope>

An asynchronous sequence of values produced by the operation.