Table of Contents

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 QueueChannel
logger ILogger

Properties

Channel

protected QueueChannel Channel { get; }

Property Value

QueueChannel

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 CancellationToken

The 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 CancellationToken

A 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 IMessage

The read item, or a default value if no item could be read.

Returns

bool

true if an item was read; otherwise, false.

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 CancellationToken

A 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. .