Class NotSupportedChannelReader
public class NotSupportedChannelReader : ChannelReader<IMessage>
- Inheritance
-
NotSupportedChannelReader
- Inherited Members
Properties
Completion
Gets a Task that completes when no more data will ever be available to be read from this channel.
public override Task Completion { 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. .