Class QueueChannelReader
- Namespace
- Steeltoe.Integration.Channel
- Assembly
- Steeltoe.Integration.IntegrationBase.dll
public class QueueChannelReader : ChannelReader<IMessage>
- Inheritance
-
QueueChannelReader
- Inherited Members
Constructors
QueueChannelReader(QueueChannel, ILogger)
public QueueChannelReader(QueueChannel channel, ILogger logger = null)
Parameters
channel
QueueChannellogger
ILogger
Properties
Channel
protected QueueChannel Channel { get; }
Property Value
Methods
ReadAllAsync(CancellationToken)
Creates an IAsyncEnumerable<T> that enables reading all of the data from the channel.
public override IAsyncEnumerable<IMessage> ReadAllAsync(CancellationToken cancellationToken = default)
Parameters
cancellationToken
CancellationTokenThe cancellation token to use to cancel the enumeration.
Returns
- IAsyncEnumerable<IMessage>
The created async enumerable.
ReadAsync(CancellationToken)
Asynchronously reads an item from the channel.
public override ValueTask<IMessage> ReadAsync(CancellationToken cancellationToken = default)
Parameters
cancellationToken
CancellationTokenA CancellationToken used to cancel the read operation.
Returns
- ValueTask<IMessage>
A ValueTask<TResult> that represents the asynchronous read operation.
TryRead(out IMessage)
Attempts to read an item from the channel.
public override bool TryRead(out IMessage item)
Parameters
item
IMessageThe read item, or a default value if no item could be read.
Returns
WaitToReadAsync(CancellationToken)
Returns a ValueTask<TResult> that will complete when data is available to read.
public override ValueTask<bool> WaitToReadAsync(CancellationToken cancellationToken = default)
Parameters
cancellationToken
CancellationTokenA CancellationToken used to cancel the wait operation.
Returns
- ValueTask<bool>
A ValueTask<TResult> that will complete with a true result when data is available to read or with a false result when no further data will ever be available to be read due to the channel completing successfully. If the channel completes with an exception, the task will also complete with an exception. .