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
transportIMessagingProtocolThe transport.
capacityintThe capacity.
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.
StreamAsync(string, TransportEnvelope, TimeSpan, CancellationToken)
Performs the stream async operation.
public IAsyncEnumerable<TransportEnvelope> StreamAsync(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
- IAsyncEnumerable<TransportEnvelope>
An asynchronous sequence of values produced by the operation.