ChannelReader<T>.ReadAllAsync(CancellationToken) Method
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Creates an IAsyncEnumerable<T> that enables reading all of the data from the channel.
public virtual System.Collections.Generic.IAsyncEnumerable<T> ReadAllAsync (System.Threading.CancellationToken cancellationToken = default);
abstract member ReadAllAsync : System.Threading.CancellationToken -> System.Collections.Generic.IAsyncEnumerable<'T>
override this.ReadAllAsync : System.Threading.CancellationToken -> System.Collections.Generic.IAsyncEnumerable<'T>
Public Overridable Function ReadAllAsync (Optional cancellationToken As CancellationToken = Nothing) As IAsyncEnumerable(Of T)
- cancellationToken
- CancellationToken
The cancellation token to use to cancel the enumeration. If data is immediately ready for reading, then that data may be yielded even after cancellation has been requested.
The created async enumerable.
The cancellation token was canceled. This exception is stored into the returned task.
Each MoveNextAsync() call that returns true
will read the next item out of the channel.
MoveNextAsync() returns false
once no more data is or will ever be available to read.
منتج | الإصدارات |
---|---|
.NET | Core 3.0, Core 3.1, 5, 6 (package-provided), 6, 7 (package-provided), 7, 8 (package-provided), 8, 9 (package-provided), 9 |
.NET Framework | 4.7 (package-provided), 4.7.1 (package-provided), 4.7.2 (package-provided), 4.8 (package-provided) |
.NET Standard | 2.0 (package-provided), 2.1 (package-provided) |
ملاحظات .NET
.NET هو مشروع مصدر مفتوح. حدد رابطًا لتقديم الملاحظات: